From 2266a1ac2e80571701e965b394147532a3d80dbb Mon Sep 17 00:00:00 2001 From: Knative Automation Date: Tue, 9 Jan 2024 01:40:54 +0000 Subject: [PATCH] upgrade to latest dependencies bumping knative.dev/hack 2f27d6e...3ea694d: > 3ea694d include additional k8s bash file when updating exec permission (# 357) bumping knative.dev/pkg 4c06610...de3e9cc: > de3e9cc Fixing all deprecated use of sets.String (# 2915) > a65a9e2 lower log level for AdmissionController.Admit validation failures (# 2905) bumping knative.dev/hack/schema 2f27d6e...3ea694d: > 3ea694d include additional k8s bash file when updating exec permission (# 357) Signed-off-by: Knative Automation --- go.mod | 6 +++--- go.sum | 12 ++++++------ .../v1alpha1/addressableservice/reconciler.go | 10 +++++----- .../samples/v1alpha1/simpledeployment/reconciler.go | 10 +++++----- vendor/knative.dev/hack/codegen-library.sh | 1 + .../generators/reconciler_reconciler.go | 6 +++--- .../pkg/configmap/informer/synced_callback.go | 4 ++-- vendor/knative.dev/pkg/configmap/parse.go | 6 +++--- vendor/knative.dev/pkg/hash/bucketer.go | 10 +++++----- vendor/knative.dev/pkg/hash/hash.go | 12 ++++++------ vendor/knative.dev/pkg/leaderelection/context.go | 4 ++-- vendor/knative.dev/pkg/logging/object_encoders.go | 2 +- .../resourcesemantics/validation/validation_admit.go | 2 +- vendor/modules.txt | 6 +++--- 14 files changed, 46 insertions(+), 45 deletions(-) diff --git a/go.mod b/go.mod index 7f71f5eae..7b7acb7b2 100644 --- a/go.mod +++ b/go.mod @@ -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 ( diff --git a/go.sum b/go.sum index 6c065fe2c..2fc7687b9 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/pkg/client/injection/reconciler/samples/v1alpha1/addressableservice/reconciler.go b/pkg/client/injection/reconciler/samples/v1alpha1/addressableservice/reconciler.go index 9b2c9a872..693e5b2d8 100644 --- a/pkg/client/injection/reconciler/samples/v1alpha1/addressableservice/reconciler.go +++ b/pkg/client/injection/reconciler/samples/v1alpha1/addressableservice/reconciler.go @@ -346,14 +346,14 @@ func (r *reconcilerImpl) updateStatus(ctx context.Context, logger *zap.SugaredLo // updateFinalizersFiltered will update the Finalizers of the resource. // TODO: this method could be generic and sync all finalizers. For now it only // updates defaultFinalizerName or its override. -func (r *reconcilerImpl) updateFinalizersFiltered(ctx context.Context, resource *v1alpha1.AddressableService, desiredFinalizers sets.String) (*v1alpha1.AddressableService, error) { +func (r *reconcilerImpl) updateFinalizersFiltered(ctx context.Context, resource *v1alpha1.AddressableService, desiredFinalizers sets.Set[string]) (*v1alpha1.AddressableService, error) { // Don't modify the informers copy. existing := resource.DeepCopy() var finalizers []string // If there's nothing to update, just return. - existingFinalizers := sets.NewString(existing.Finalizers...) + existingFinalizers := sets.New[string](existing.Finalizers...) if desiredFinalizers.Has(r.finalizerName) { if existingFinalizers.Has(r.finalizerName) { @@ -369,7 +369,7 @@ func (r *reconcilerImpl) updateFinalizersFiltered(ctx context.Context, resource } // Remove the finalizer. existingFinalizers.Delete(r.finalizerName) - finalizers = existingFinalizers.List() + finalizers = sets.List(existingFinalizers) } mergePatch := map[string]interface{}{ @@ -403,7 +403,7 @@ func (r *reconcilerImpl) setFinalizerIfFinalizer(ctx context.Context, resource * return resource, nil } - finalizers := sets.NewString(resource.Finalizers...) + finalizers := sets.New[string](resource.Finalizers...) // If this resource is not being deleted, mark the finalizer. if resource.GetDeletionTimestamp().IsZero() { @@ -422,7 +422,7 @@ func (r *reconcilerImpl) clearFinalizer(ctx context.Context, resource *v1alpha1. return resource, nil } - finalizers := sets.NewString(resource.Finalizers...) + finalizers := sets.New[string](resource.Finalizers...) if reconcileEvent != nil { var event *reconciler.ReconcilerEvent diff --git a/pkg/client/injection/reconciler/samples/v1alpha1/simpledeployment/reconciler.go b/pkg/client/injection/reconciler/samples/v1alpha1/simpledeployment/reconciler.go index 4f511735d..c192544b0 100644 --- a/pkg/client/injection/reconciler/samples/v1alpha1/simpledeployment/reconciler.go +++ b/pkg/client/injection/reconciler/samples/v1alpha1/simpledeployment/reconciler.go @@ -346,14 +346,14 @@ func (r *reconcilerImpl) updateStatus(ctx context.Context, logger *zap.SugaredLo // updateFinalizersFiltered will update the Finalizers of the resource. // TODO: this method could be generic and sync all finalizers. For now it only // updates defaultFinalizerName or its override. -func (r *reconcilerImpl) updateFinalizersFiltered(ctx context.Context, resource *v1alpha1.SimpleDeployment, desiredFinalizers sets.String) (*v1alpha1.SimpleDeployment, error) { +func (r *reconcilerImpl) updateFinalizersFiltered(ctx context.Context, resource *v1alpha1.SimpleDeployment, desiredFinalizers sets.Set[string]) (*v1alpha1.SimpleDeployment, error) { // Don't modify the informers copy. existing := resource.DeepCopy() var finalizers []string // If there's nothing to update, just return. - existingFinalizers := sets.NewString(existing.Finalizers...) + existingFinalizers := sets.New[string](existing.Finalizers...) if desiredFinalizers.Has(r.finalizerName) { if existingFinalizers.Has(r.finalizerName) { @@ -369,7 +369,7 @@ func (r *reconcilerImpl) updateFinalizersFiltered(ctx context.Context, resource } // Remove the finalizer. existingFinalizers.Delete(r.finalizerName) - finalizers = existingFinalizers.List() + finalizers = sets.List(existingFinalizers) } mergePatch := map[string]interface{}{ @@ -403,7 +403,7 @@ func (r *reconcilerImpl) setFinalizerIfFinalizer(ctx context.Context, resource * return resource, nil } - finalizers := sets.NewString(resource.Finalizers...) + finalizers := sets.New[string](resource.Finalizers...) // If this resource is not being deleted, mark the finalizer. if resource.GetDeletionTimestamp().IsZero() { @@ -422,7 +422,7 @@ func (r *reconcilerImpl) clearFinalizer(ctx context.Context, resource *v1alpha1. return resource, nil } - finalizers := sets.NewString(resource.Finalizers...) + finalizers := sets.New[string](resource.Finalizers...) if reconcileEvent != nil { var event *reconciler.ReconcilerEvent diff --git a/vendor/knative.dev/hack/codegen-library.sh b/vendor/knative.dev/hack/codegen-library.sh index 0f21d457e..5f713dd43 100644 --- a/vendor/knative.dev/hack/codegen-library.sh +++ b/vendor/knative.dev/hack/codegen-library.sh @@ -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 diff --git a/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/reconciler_reconciler.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/reconciler_reconciler.go index f27c15633..0f9e4d0a6 100644 --- a/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/reconciler_reconciler.go +++ b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/reconciler_reconciler.go @@ -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", @@ -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{}{ diff --git a/vendor/knative.dev/pkg/configmap/informer/synced_callback.go b/vendor/knative.dev/pkg/configmap/informer/synced_callback.go index 355c512b5..0b3e2d3a9 100644 --- a/vendor/knative.dev/pkg/configmap/informer/synced_callback.go +++ b/vendor/knative.dev/pkg/configmap/informer/synced_callback.go @@ -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](), } } diff --git a/vendor/knative.dev/pkg/configmap/parse.go b/vendor/knative.dev/pkg/configmap/parse.go index e733e3838..d8caba3c3 100644 --- a/vendor/knative.dev/pkg/configmap/parse.go +++ b/vendor/knative.dev/pkg/configmap/parse.go @@ -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 } diff --git a/vendor/knative.dev/pkg/hash/bucketer.go b/vendor/knative.dev/pkg/hash/bucketer.go index 6da0cb30c..4e97efec8 100644 --- a/vendor/knative.dev/pkg/hash/bucketer.go +++ b/vendor/knative.dev/pkg/hash/bucketer.go @@ -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 @@ -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, @@ -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 } @@ -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 diff --git a/vendor/knative.dev/pkg/hash/hash.go b/vendor/knative.dev/pkg/hash/hash.go index 1c4c5352f..ae2969acd 100644 --- a/vendor/knative.dev/pkg/hash/hash.go +++ b/vendor/knative.dev/pkg/hash/hash.go @@ -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)) } @@ -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) @@ -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 } @@ -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 { diff --git a/vendor/knative.dev/pkg/leaderelection/context.go b/vendor/knative.dev/pkg/leaderelection/context.go index f52733ea3..b0122b84a 100644 --- a/vendor/knative.dev/pkg/leaderelection/context.go +++ b/vendor/knative.dev/pkg/leaderelection/context.go @@ -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)) } @@ -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)) } diff --git a/vendor/knative.dev/pkg/logging/object_encoders.go b/vendor/knative.dev/pkg/logging/object_encoders.go index 9a30f8aab..de750c259 100644 --- a/vendor/knative.dev/pkg/logging/object_encoders.go +++ b/vendor/knative.dev/pkg/logging/object_encoders.go @@ -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 diff --git a/vendor/knative.dev/pkg/webhook/resourcesemantics/validation/validation_admit.go b/vendor/knative.dev/pkg/webhook/resourcesemantics/validation/validation_admit.go index 002d60791..e601890af 100644 --- a/vendor/knative.dev/pkg/webhook/resourcesemantics/validation/validation_admit.go +++ b/vendor/knative.dev/pkg/webhook/resourcesemantics/validation/validation_admit.go @@ -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 diff --git a/vendor/modules.txt b/vendor/modules.txt index 5d541b062..bd755eb97 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -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