Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[main] Upgrade to latest dependencies #832

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ require (
k8s.io/client-go v0.27.6
k8s.io/code-generator v0.27.6
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f
knative.dev/hack v0.0.0-20240108131554-2f27d6e3e2fd
knative.dev/hack/schema v0.0.0-20240108131554-2f27d6e3e2fd
knative.dev/pkg v0.0.0-20240108131035-4c0661087b13
knative.dev/hack v0.0.0-20240108153050-3ea694d6dad7
knative.dev/hack/schema v0.0.0-20240108153050-3ea694d6dad7
knative.dev/pkg v0.0.0-20240108152118-de3e9cc204c9
)

require (
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -688,12 +688,12 @@ k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5F
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg=
k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY=
k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/hack v0.0.0-20240108131554-2f27d6e3e2fd h1:dScfHjr/adhdZlJKF1UbAX2waUOgBNM8mshCMRvDBAY=
knative.dev/hack v0.0.0-20240108131554-2f27d6e3e2fd/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/hack/schema v0.0.0-20240108131554-2f27d6e3e2fd h1:yrGiCID8puunh2H1sYNeeYBMBctqK8uSLZyKHNLw4LM=
knative.dev/hack/schema v0.0.0-20240108131554-2f27d6e3e2fd/go.mod h1:3pWwBLnTZSM9psSgCAvhKOHIPTzqfEMlWRpDu6IYhK0=
knative.dev/pkg v0.0.0-20240108131035-4c0661087b13 h1:DHkNQEVY8/1H/Xh3e72jYcMxyK/pP5LZhC0vnFXnCsE=
knative.dev/pkg v0.0.0-20240108131035-4c0661087b13/go.mod h1:YzKN/kzcJPhL+Z4fwuzbaiEnRLIbYvOiZUuCWFJ7PRA=
knative.dev/hack v0.0.0-20240108153050-3ea694d6dad7 h1:mICurlRke2mlKP3LmyWYQYl6KZe80rYP5+ag9w2HQLA=
knative.dev/hack v0.0.0-20240108153050-3ea694d6dad7/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/hack/schema v0.0.0-20240108153050-3ea694d6dad7 h1:YiCuqNhCQLltWXiPOfy1E40/d9FyfhBAS8UBiJPSE3I=
knative.dev/hack/schema v0.0.0-20240108153050-3ea694d6dad7/go.mod h1:3pWwBLnTZSM9psSgCAvhKOHIPTzqfEMlWRpDu6IYhK0=
knative.dev/pkg v0.0.0-20240108152118-de3e9cc204c9 h1:4nsTvrgApGtLTt6Gpo7ulJS03pBI+wSJ8+EOwVamDx0=
knative.dev/pkg v0.0.0-20240108152118-de3e9cc204c9/go.mod h1:YzKN/kzcJPhL+Z4fwuzbaiEnRLIbYvOiZUuCWFJ7PRA=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/knative.dev/hack/codegen-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ export CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${REPO_ROOT_DIR}; ls -d -1 ./vendor/k8s.i
export KNATIVE_CODEGEN_PKG=${KNATIVE_CODEGEN_PKG:-$(cd ${REPO_ROOT_DIR}; ls -d -1 ./vendor/knative.dev/pkg 2>/dev/null || echo "${REPO_ROOT_DIR}")}

[ -x ${CODEGEN_PKG}/generate-groups.sh ] || chmod +x ${CODEGEN_PKG}/generate-groups.sh
[ -x ${CODEGEN_PKG}/generate-internal-groups.sh ] || chmod +x ${CODEGEN_PKG}/generate-internal-groups.sh
[ -x ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh ] || chmod +x ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ func (g *reconcilerReconcilerGenerator) GenerateType(c *generator.Context, t *ty
}),
"setsNewString": c.Universe.Function(types.Name{
Package: "k8s.io/apimachinery/pkg/util/sets",
Name: "NewString",
Name: "New[string]",
}),
"setsString": c.Universe.Type(types.Name{
Package: "k8s.io/apimachinery/pkg/util/sets",
Name: "String",
Name: "Set[string]",
}),
"controllerOptions": c.Universe.Type(types.Name{
Package: "knative.dev/pkg/controller",
Expand Down Expand Up @@ -630,7 +630,7 @@ func (r *reconcilerImpl) updateFinalizersFiltered(ctx {{.contextContext|raw}}, r
}
// Remove the finalizer.
existingFinalizers.Delete(r.finalizerName)
finalizers = existingFinalizers.List()
finalizers = sets.List(existingFinalizers)
}

mergePatch := map[string]interface{}{
Expand Down
4 changes: 2 additions & 2 deletions vendor/knative.dev/pkg/configmap/informer/synced_callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import (
// namedWaitGroup is used to increment and decrement a WaitGroup by name
type namedWaitGroup struct {
waitGroup sync.WaitGroup
keys sets.String
keys sets.Set[string]
mu sync.Mutex
}

// newNamedWaitGroup returns an instantiated namedWaitGroup.
func newNamedWaitGroup() *namedWaitGroup {
return &namedWaitGroup{
keys: sets.NewString(),
keys: sets.New[string](),
}
}

Expand Down
6 changes: 3 additions & 3 deletions vendor/knative.dev/pkg/configmap/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ func AsDuration(key string, target *time.Duration) ParseFunc {
}
}

// AsStringSet parses the value at key as a sets.String (split by ',') into the target, if it exists.
func AsStringSet(key string, target *sets.String) ParseFunc {
// AsStringSet parses the value at key as a sets.Set[string] (split by ',') into the target, if it exists.
func AsStringSet(key string, target *sets.Set[string]) ParseFunc {
return func(data map[string]string) error {
if raw, ok := data[key]; ok {
splitted := strings.Split(raw, ",")
for i, v := range splitted {
splitted[i] = strings.TrimSpace(v)
}
*target = sets.NewString(splitted...)
*target = sets.New[string](splitted...)
}
return nil
}
Expand Down
10 changes: 5 additions & 5 deletions vendor/knative.dev/pkg/hash/bucketer.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type BucketSet struct {
// mu guards buckets.
mu sync.RWMutex
// All the bucket names. Needed for building hash universe.
buckets sets.String
buckets sets.Set[string]
}

// Bucket implements reconciler.Bucket and wraps around BuketSet
Expand All @@ -59,7 +59,7 @@ func newCache() *lru.Cache {

// NewBucketSet creates a new bucket set with the given universe
// of bucket names.
func NewBucketSet(bucketList sets.String) *BucketSet {
func NewBucketSet(bucketList sets.Set[string]) *BucketSet {
return &BucketSet{
cache: newCache(),
buckets: bucketList,
Expand Down Expand Up @@ -106,7 +106,7 @@ func (bs *BucketSet) Owner(key string) string {
}

// Returns a single element from the set.
func GetAny(s sets.String) (string, bool) {
func GetAny(s sets.Set[string]) (string, bool) {
for key := range s {
return key, true
}
Expand All @@ -124,11 +124,11 @@ func (bs *BucketSet) BucketList() []string {
bs.mu.RLock()
defer bs.mu.RUnlock()

return bs.buckets.List()
return sets.List(bs.buckets)
}

// Update updates the universe of buckets.
func (bs *BucketSet) Update(newB sets.String) {
func (bs *BucketSet) Update(newB sets.Set[string]) {
bs.mu.Lock()
defer bs.mu.Unlock()
// In theory we can iterate over the map and
Expand Down
12 changes: 6 additions & 6 deletions vendor/knative.dev/pkg/hash/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ type hashData struct {
step int
}

func (hd *hashData) fromIndexSet(s sets.Int) sets.String {
ret := make(sets.String, len(s))
func (hd *hashData) fromIndexSet(s sets.Set[int]) sets.Set[string] {
ret := make(sets.Set[string], len(s))
for v := range s {
ret.Insert(hd.nameForHIndex(v))
}
Expand All @@ -72,14 +72,14 @@ func (hd *hashData) nameForHIndex(hi int) string {
return hd.nameLookup[hd.hashPool[hi]]
}

func buildHashes(in sets.String, target string) *hashData {
func buildHashes(in sets.Set[string], target string) *hashData {
// Any one changing this function must execute
// `go test -run=TestOverlay -count=200`.
// This is to ensure there is no regression in the selection
// algorithm.

// Sorted list to ensure consistent results every time.
from := in.List()
from := sets.List(in)
// Write in two pieces, so we don't allocate temp string which is sum of both.
buf := bytes.NewBufferString(target)
buf.WriteString(startSalt)
Expand Down Expand Up @@ -126,7 +126,7 @@ func buildHashes(in sets.String, target string) *hashData {
// ChooseSubset is an internal function and presumes sanitized inputs.
// TODO(vagababov): once initial impl is ready, think about how to cache
// the prepared data.
func ChooseSubset(from sets.String, n int, target string) sets.String {
func ChooseSubset(from sets.Set[string], n int, target string) sets.Set[string] {
if n >= len(from) {
return from
}
Expand All @@ -140,7 +140,7 @@ func ChooseSubset(from sets.String, n int, target string) sets.String {
// 2.1. While that index is already selected pick next index
// 3. Advance angle by `step`
// 4. Goto 1.
selection := sets.NewInt()
selection := sets.New[int]()
angle := hashData.start
hpl := len(hashData.hashPool)
for len(selection) < n {
Expand Down
4 changes: 2 additions & 2 deletions vendor/knative.dev/pkg/leaderelection/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func newStandardBuckets(queueName string, cc ComponentConfig) []reconciler.Bucke
return standardBucketName(i, queueName, cc)
}
}
names := make(sets.String, cc.Buckets)
names := make(sets.Set[string], cc.Buckets)
for i := uint32(0); i < cc.Buckets; i++ {
names.Insert(ln(i))
}
Expand Down Expand Up @@ -237,7 +237,7 @@ func NewStatefulSetBucketAndSet(buckets int) (reconciler.Bucket, *hash.BucketSet
ssc.StatefulSetID.ordinal, buckets)
}

names := make(sets.String, buckets)
names := make(sets.Set[string], buckets)
for i := 0; i < buckets; i++ {
names.Insert(statefulSetPodDNS(i, ssc))
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/pkg/logging/object_encoders.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
//
// logger.Info("Revision State", zap.Object("healthy", logging.StringSet(healthySet)),
// zap.Object("unhealthy", logging.StringSet(unhealthySet)))
func StringSet(s sets.String) zapcore.ObjectMarshalerFunc {
func StringSet(s sets.Set[string]) zapcore.ObjectMarshalerFunc {
return func(enc zapcore.ObjectEncoder) error {
enc.AddString("keys", strings.Join(s.UnsortedList(), ","))
return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func validate(ctx context.Context, resource resourcesemantics.GenericCRD, req *a
}

if result := resource.Validate(ctx); result != nil {
logger.Errorw("Failed the resource specific validation", zap.Error(err))
logger.Infow("Failed the resource specific validation", zap.Error(result))
// While we have the strong typing of apis.FieldError, partition the
// returned error into the error-level diagnostics and warning-level
// diagnostics, so that the admission response can embed things into
Expand Down
6 changes: 3 additions & 3 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -828,16 +828,16 @@ k8s.io/utils/net
k8s.io/utils/pointer
k8s.io/utils/strings/slices
k8s.io/utils/trace
# knative.dev/hack v0.0.0-20240108131554-2f27d6e3e2fd
# knative.dev/hack v0.0.0-20240108153050-3ea694d6dad7
## explicit; go 1.18
knative.dev/hack
# knative.dev/hack/schema v0.0.0-20240108131554-2f27d6e3e2fd
# knative.dev/hack/schema v0.0.0-20240108153050-3ea694d6dad7
## explicit; go 1.18
knative.dev/hack/schema/commands
knative.dev/hack/schema/docs
knative.dev/hack/schema/registry
knative.dev/hack/schema/schema
# knative.dev/pkg v0.0.0-20240108131035-4c0661087b13
# knative.dev/pkg v0.0.0-20240108152118-de3e9cc204c9
## explicit; go 1.18
knative.dev/pkg/apis
knative.dev/pkg/apis/duck
Expand Down
Loading