Skip to content

Commit

Permalink
upgrade to latest dependencies
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
knative-automation committed Jan 9, 2024
1 parent d66e24d commit b7184ea
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 33 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ 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-20231201014241-7030d5bf584d
knative.dev/pkg v0.0.0-20240108071142-697d66936c81
knative.dev/hack v0.0.0-20240108153050-3ea694d6dad7
knative.dev/pkg v0.0.0-20240108152118-de3e9cc204c9
)

require (
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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/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-20231201014241-7030d5bf584d h1:IqXY770znXS9tLJDEh+OUcLMgtIFslSxqao3uplpUlY=
knative.dev/hack v0.0.0-20231201014241-7030d5bf584d/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/pkg v0.0.0-20240108071142-697d66936c81 h1:GRQr115uedAIFF6oKSnGO5zzOGx+BFyWFNiWbQAsDdU=
knative.dev/pkg v0.0.0-20240108071142-697d66936c81/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/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.

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
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
4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -693,10 +693,10 @@ k8s.io/utils/net
k8s.io/utils/pointer
k8s.io/utils/strings/slices
k8s.io/utils/trace
# knative.dev/hack v0.0.0-20231201014241-7030d5bf584d
# knative.dev/hack v0.0.0-20240108153050-3ea694d6dad7
## explicit; go 1.18
knative.dev/hack
# knative.dev/pkg v0.0.0-20240108071142-697d66936c81
# knative.dev/pkg v0.0.0-20240108152118-de3e9cc204c9
## explicit; go 1.18
knative.dev/pkg/apis
knative.dev/pkg/apis/duck
Expand Down

0 comments on commit b7184ea

Please sign in to comment.