upgrade to latest dependencies (#819)

bumping knative.dev/pkg 697d669...de3e9cc:
  > de3e9cc Fixing all deprecated use of sets.String (# 2915)
  > a65a9e2 lower log level for AdmissionController.Admit validation  failures (# 2905)
  > 4c06610 Update community files (# 2929)
bumping knative.dev/hack 7030d5b...3ea694d:
  > 3ea694d include additional k8s bash file when updating exec permission (# 357)
  > 2f27d6e Update community files (# 356)

Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
Knative Automation 2024-01-09 03:47:56 -05:00 committed by GitHub
parent d66e24d0d6
commit 1609145e5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 34 additions and 33 deletions

4
go.mod
View File

@ -11,8 +11,8 @@ require (
k8s.io/client-go v0.27.6 k8s.io/client-go v0.27.6
k8s.io/code-generator v0.27.6 k8s.io/code-generator v0.27.6
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f
knative.dev/hack v0.0.0-20231201014241-7030d5bf584d knative.dev/hack v0.0.0-20240108153050-3ea694d6dad7
knative.dev/pkg v0.0.0-20240108071142-697d66936c81 knative.dev/pkg v0.0.0-20240108152118-de3e9cc204c9
) )
require ( require (

8
go.sum
View File

@ -673,10 +673,10 @@ 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/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 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY=
k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/hack v0.0.0-20231201014241-7030d5bf584d h1:IqXY770znXS9tLJDEh+OUcLMgtIFslSxqao3uplpUlY= knative.dev/hack v0.0.0-20240108153050-3ea694d6dad7 h1:mICurlRke2mlKP3LmyWYQYl6KZe80rYP5+ag9w2HQLA=
knative.dev/hack v0.0.0-20231201014241-7030d5bf584d/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= knative.dev/hack v0.0.0-20240108153050-3ea694d6dad7/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/pkg v0.0.0-20240108071142-697d66936c81 h1:GRQr115uedAIFF6oKSnGO5zzOGx+BFyWFNiWbQAsDdU= knative.dev/pkg v0.0.0-20240108152118-de3e9cc204c9 h1:4nsTvrgApGtLTt6Gpo7ulJS03pBI+wSJ8+EOwVamDx0=
knative.dev/pkg v0.0.0-20240108071142-697d66936c81/go.mod h1:YzKN/kzcJPhL+Z4fwuzbaiEnRLIbYvOiZUuCWFJ7PRA= 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/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/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=

View File

@ -346,14 +346,14 @@ func (r *reconcilerImpl) updateStatus(ctx context.Context, logger *zap.SugaredLo
// updateFinalizersFiltered will update the Finalizers of the resource. // updateFinalizersFiltered will update the Finalizers of the resource.
// TODO: this method could be generic and sync all finalizers. For now it only // TODO: this method could be generic and sync all finalizers. For now it only
// updates defaultFinalizerName or its override. // updates defaultFinalizerName or its override.
func (r *reconcilerImpl) updateFinalizersFiltered(ctx context.Context, resource *v1alpha1.Image, desiredFinalizers sets.String) (*v1alpha1.Image, error) { func (r *reconcilerImpl) updateFinalizersFiltered(ctx context.Context, resource *v1alpha1.Image, desiredFinalizers sets.Set[string]) (*v1alpha1.Image, error) {
// Don't modify the informers copy. // Don't modify the informers copy.
existing := resource.DeepCopy() existing := resource.DeepCopy()
var finalizers []string var finalizers []string
// If there's nothing to update, just return. // 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 desiredFinalizers.Has(r.finalizerName) {
if existingFinalizers.Has(r.finalizerName) { if existingFinalizers.Has(r.finalizerName) {
@ -369,7 +369,7 @@ func (r *reconcilerImpl) updateFinalizersFiltered(ctx context.Context, resource
} }
// Remove the finalizer. // Remove the finalizer.
existingFinalizers.Delete(r.finalizerName) existingFinalizers.Delete(r.finalizerName)
finalizers = existingFinalizers.List() finalizers = sets.List(existingFinalizers)
} }
mergePatch := map[string]interface{}{ mergePatch := map[string]interface{}{
@ -403,7 +403,7 @@ func (r *reconcilerImpl) setFinalizerIfFinalizer(ctx context.Context, resource *
return resource, nil 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 this resource is not being deleted, mark the finalizer.
if resource.GetDeletionTimestamp().IsZero() { if resource.GetDeletionTimestamp().IsZero() {
@ -422,7 +422,7 @@ func (r *reconcilerImpl) clearFinalizer(ctx context.Context, resource *v1alpha1.
return resource, nil return resource, nil
} }
finalizers := sets.NewString(resource.Finalizers...) finalizers := sets.New[string](resource.Finalizers...)
if reconcileEvent != nil { if reconcileEvent != nil {
var event *reconciler.ReconcilerEvent var event *reconciler.ReconcilerEvent

View File

@ -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}")} 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-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 [ -x ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh ] || chmod +x ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh

View File

@ -156,11 +156,11 @@ func (g *reconcilerReconcilerGenerator) GenerateType(c *generator.Context, t *ty
}), }),
"setsNewString": c.Universe.Function(types.Name{ "setsNewString": c.Universe.Function(types.Name{
Package: "k8s.io/apimachinery/pkg/util/sets", Package: "k8s.io/apimachinery/pkg/util/sets",
Name: "NewString", Name: "New[string]",
}), }),
"setsString": c.Universe.Type(types.Name{ "setsString": c.Universe.Type(types.Name{
Package: "k8s.io/apimachinery/pkg/util/sets", Package: "k8s.io/apimachinery/pkg/util/sets",
Name: "String", Name: "Set[string]",
}), }),
"controllerOptions": c.Universe.Type(types.Name{ "controllerOptions": c.Universe.Type(types.Name{
Package: "knative.dev/pkg/controller", Package: "knative.dev/pkg/controller",
@ -630,7 +630,7 @@ func (r *reconcilerImpl) updateFinalizersFiltered(ctx {{.contextContext|raw}}, r
} }
// Remove the finalizer. // Remove the finalizer.
existingFinalizers.Delete(r.finalizerName) existingFinalizers.Delete(r.finalizerName)
finalizers = existingFinalizers.List() finalizers = sets.List(existingFinalizers)
} }
mergePatch := map[string]interface{}{ mergePatch := map[string]interface{}{

View File

@ -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. // 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.String) ParseFunc { func AsStringSet(key string, target *sets.Set[string]) ParseFunc {
return func(data map[string]string) error { return func(data map[string]string) error {
if raw, ok := data[key]; ok { if raw, ok := data[key]; ok {
splitted := strings.Split(raw, ",") splitted := strings.Split(raw, ",")
for i, v := range splitted { for i, v := range splitted {
splitted[i] = strings.TrimSpace(v) splitted[i] = strings.TrimSpace(v)
} }
*target = sets.NewString(splitted...) *target = sets.New[string](splitted...)
} }
return nil return nil
} }

View File

@ -38,7 +38,7 @@ type BucketSet struct {
// mu guards buckets. // mu guards buckets.
mu sync.RWMutex mu sync.RWMutex
// All the bucket names. Needed for building hash universe. // All the bucket names. Needed for building hash universe.
buckets sets.String buckets sets.Set[string]
} }
// Bucket implements reconciler.Bucket and wraps around BuketSet // 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 // NewBucketSet creates a new bucket set with the given universe
// of bucket names. // of bucket names.
func NewBucketSet(bucketList sets.String) *BucketSet { func NewBucketSet(bucketList sets.Set[string]) *BucketSet {
return &BucketSet{ return &BucketSet{
cache: newCache(), cache: newCache(),
buckets: bucketList, buckets: bucketList,
@ -106,7 +106,7 @@ func (bs *BucketSet) Owner(key string) string {
} }
// Returns a single element from the set. // 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 { for key := range s {
return key, true return key, true
} }
@ -124,11 +124,11 @@ func (bs *BucketSet) BucketList() []string {
bs.mu.RLock() bs.mu.RLock()
defer bs.mu.RUnlock() defer bs.mu.RUnlock()
return bs.buckets.List() return sets.List(bs.buckets)
} }
// Update updates the universe of 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() bs.mu.Lock()
defer bs.mu.Unlock() defer bs.mu.Unlock()
// In theory we can iterate over the map and // In theory we can iterate over the map and

View File

@ -60,8 +60,8 @@ type hashData struct {
step int step int
} }
func (hd *hashData) fromIndexSet(s sets.Int) sets.String { func (hd *hashData) fromIndexSet(s sets.Set[int]) sets.Set[string] {
ret := make(sets.String, len(s)) ret := make(sets.Set[string], len(s))
for v := range s { for v := range s {
ret.Insert(hd.nameForHIndex(v)) ret.Insert(hd.nameForHIndex(v))
} }
@ -72,14 +72,14 @@ func (hd *hashData) nameForHIndex(hi int) string {
return hd.nameLookup[hd.hashPool[hi]] 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 // Any one changing this function must execute
// `go test -run=TestOverlay -count=200`. // `go test -run=TestOverlay -count=200`.
// This is to ensure there is no regression in the selection // This is to ensure there is no regression in the selection
// algorithm. // algorithm.
// Sorted list to ensure consistent results every time. // 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. // Write in two pieces, so we don't allocate temp string which is sum of both.
buf := bytes.NewBufferString(target) buf := bytes.NewBufferString(target)
buf.WriteString(startSalt) buf.WriteString(startSalt)
@ -126,7 +126,7 @@ func buildHashes(in sets.String, target string) *hashData {
// ChooseSubset is an internal function and presumes sanitized inputs. // ChooseSubset is an internal function and presumes sanitized inputs.
// TODO(vagababov): once initial impl is ready, think about how to cache // TODO(vagababov): once initial impl is ready, think about how to cache
// the prepared data. // 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) { if n >= len(from) {
return 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 // 2.1. While that index is already selected pick next index
// 3. Advance angle by `step` // 3. Advance angle by `step`
// 4. Goto 1. // 4. Goto 1.
selection := sets.NewInt() selection := sets.New[int]()
angle := hashData.start angle := hashData.start
hpl := len(hashData.hashPool) hpl := len(hashData.hashPool)
for len(selection) < n { for len(selection) < n {

View File

@ -190,7 +190,7 @@ func newStandardBuckets(queueName string, cc ComponentConfig) []reconciler.Bucke
return standardBucketName(i, queueName, cc) 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++ { for i := uint32(0); i < cc.Buckets; i++ {
names.Insert(ln(i)) names.Insert(ln(i))
} }
@ -237,7 +237,7 @@ func NewStatefulSetBucketAndSet(buckets int) (reconciler.Bucket, *hash.BucketSet
ssc.StatefulSetID.ordinal, buckets) ssc.StatefulSetID.ordinal, buckets)
} }
names := make(sets.String, buckets) names := make(sets.Set[string], buckets)
for i := 0; i < buckets; i++ { for i := 0; i < buckets; i++ {
names.Insert(statefulSetPodDNS(i, ssc)) names.Insert(statefulSetPodDNS(i, ssc))
} }

View File

@ -37,7 +37,7 @@ import (
// //
// logger.Info("Revision State", zap.Object("healthy", logging.StringSet(healthySet)), // logger.Info("Revision State", zap.Object("healthy", logging.StringSet(healthySet)),
// zap.Object("unhealthy", logging.StringSet(unhealthySet))) // 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 { return func(enc zapcore.ObjectEncoder) error {
enc.AddString("keys", strings.Join(s.UnsortedList(), ",")) enc.AddString("keys", strings.Join(s.UnsortedList(), ","))
return nil return nil

4
vendor/modules.txt vendored
View File

@ -693,10 +693,10 @@ k8s.io/utils/net
k8s.io/utils/pointer k8s.io/utils/pointer
k8s.io/utils/strings/slices k8s.io/utils/strings/slices
k8s.io/utils/trace k8s.io/utils/trace
# knative.dev/hack v0.0.0-20231201014241-7030d5bf584d # knative.dev/hack v0.0.0-20240108153050-3ea694d6dad7
## explicit; go 1.18 ## explicit; go 1.18
knative.dev/hack knative.dev/hack
# knative.dev/pkg v0.0.0-20240108071142-697d66936c81 # knative.dev/pkg v0.0.0-20240108152118-de3e9cc204c9
## explicit; go 1.18 ## explicit; go 1.18
knative.dev/pkg/apis knative.dev/pkg/apis
knative.dev/pkg/apis/duck knative.dev/pkg/apis/duck