Skip to content

Commit

Permalink
upgrade to latest dependencies (#15683)
Browse files Browse the repository at this point in the history
bumping knative.dev/networking 3fac3bb...22a6457:
  > 22a6457 linter fixes (# 1034)
  > 61c6cb6 upgrade to latest dependencies (# 1033)
bumping knative.dev/pkg 83cd52e...accfe36:
  > accfe36 Satisfy linter (# 3132)
  > b4ff2c1 run dependabot workflow only on dependabot branches (# 3133)

Signed-off-by: Knative Automation <[email protected]>
  • Loading branch information
knative-automation authored Jan 13, 2025
1 parent c2f2b8b commit 65de262
Show file tree
Hide file tree
Showing 17 changed files with 90 additions and 86 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ require (
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
knative.dev/caching v0.0.0-20250109131528-ca99f3dde785
knative.dev/hack v0.0.0-20250109131303-f8be0ccdff36
knative.dev/networking v0.0.0-20250109151316-3fac3bb26e88
knative.dev/pkg v0.0.0-20250109201817-83cd52ed87d9
knative.dev/networking v0.0.0-20250110153017-22a6457498e8
knative.dev/pkg v0.0.0-20250110150618-accfe3649188
sigs.k8s.io/yaml v1.4.0
)

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -960,10 +960,10 @@ knative.dev/caching v0.0.0-20250109131528-ca99f3dde785 h1:CDq/3U8GeRxb+mmjK3BQ2m
knative.dev/caching v0.0.0-20250109131528-ca99f3dde785/go.mod h1:XifurIHfoPIJocfQJtDJm4st9QPOhjpXprVgp/uSU8o=
knative.dev/hack v0.0.0-20250109131303-f8be0ccdff36 h1:iZ6CwYLo+y82MXlK7PoG/cnFEB0tRdw8elBXj6c6ezE=
knative.dev/hack v0.0.0-20250109131303-f8be0ccdff36/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY=
knative.dev/networking v0.0.0-20250109151316-3fac3bb26e88 h1:QqsuHpOFeHhdgID2G9V4iDfYt3qXvXaWLPJy98yqnO4=
knative.dev/networking v0.0.0-20250109151316-3fac3bb26e88/go.mod h1:EU4KaerdVqxeELmrEiS342GlnXINvYm0mDmNN+D+xew=
knative.dev/pkg v0.0.0-20250109201817-83cd52ed87d9 h1:b4S5OUBLwlbfC9Twr+4AfEcH7zK8CKUdjdyOTirfvoU=
knative.dev/pkg v0.0.0-20250109201817-83cd52ed87d9/go.mod h1:C1u0e6tMiEkqcKsurZn2wGTH6utcTbODFwJBPyZ56lA=
knative.dev/networking v0.0.0-20250110153017-22a6457498e8 h1:ZqqTlzVZzl7PivB6HL3ebwKEQkdGYNVwtgW87UHUR4U=
knative.dev/networking v0.0.0-20250110153017-22a6457498e8/go.mod h1:TH55M/KfH3o886FQodc6WTLq7mAFvIXWTwxD4j8YKWY=
knative.dev/pkg v0.0.0-20250110150618-accfe3649188 h1:xM2blxCAN0VzKQPYqeq2jNBL7xN6Iyn1avs+Ib+ogaM=
knative.dev/pkg v0.0.0-20250110150618-accfe3649188/go.mod h1:C1u0e6tMiEkqcKsurZn2wGTH6utcTbODFwJBPyZ56lA=
pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw=
pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,17 @@ import (
"knative.dev/pkg/apis"
)

var (
allowedAnnotations = sets.New[string](
IngressClassAnnotationKey,
CertificateClassAnnotationKey,
DisableAutoTLSAnnotationKey,
DisableExternalDomainTLSAnnotationKey,
HTTPOptionAnnotationKey,

IngressClassAnnotationAltKey,
CertificateClassAnnotationAltKey,
DisableAutoTLSAnnotationAltKey,
HTTPProtocolAnnotationKey,
)
var allowedAnnotations = sets.New[string](
IngressClassAnnotationKey,
CertificateClassAnnotationKey,
DisableAutoTLSAnnotationKey,
DisableExternalDomainTLSAnnotationKey,
HTTPOptionAnnotationKey,

IngressClassAnnotationAltKey,
CertificateClassAnnotationAltKey,
DisableAutoTLSAnnotationAltKey,
HTTPProtocolAnnotationKey,
)

// ValidateAnnotations validates that `annotations` in `metadata` stanza of the
Expand Down
6 changes: 2 additions & 4 deletions vendor/knative.dev/networking/pkg/apis/networking/ports.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ const (
ServicePortNameHTTPS = "https"
)

var (
// AppProtocolH2C is the name of the external port of the service for HTTP/2, from https://github.com/kubernetes/enhancements/tree/master/keps/sig-network/3726-standard-application-protocols#new-standard-protocols
AppProtocolH2C = "kubernetes.io/h2c"
)
// AppProtocolH2C is the name of the external port of the service for HTTP/2, from https://github.com/kubernetes/enhancements/tree/master/keps/sig-network/3726-standard-application-protocols#new-standard-protocols
var AppProtocolH2C = "kubernetes.io/h2c"

// ServicePortName returns the port for the app level protocol.
func ServicePortName(proto ProtocolType) string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ type ClusterDomainClaim struct {
Spec ClusterDomainClaimSpec `json:"spec,omitempty"`
}

var (
// Check that we can create OwnerReferences to a ClusterDomainClaim.
_ kmeta.OwnerRefable = (*ClusterDomainClaim)(nil)
)
// Check that we can create OwnerReferences to a ClusterDomainClaim.
var _ kmeta.OwnerRefable = (*ClusterDomainClaim)(nil)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ import (
func (i *Ingress) GetIngressTLSForVisibility(visibility IngressVisibility) []IngressTLS {
ingressTLS := make([]IngressTLS, 0, len(i.Spec.TLS))

if i.Spec.TLS == nil || len(i.Spec.TLS) == 0 {
if len(i.Spec.TLS) == 0 {
return ingressTLS
}

for _, rule := range i.Spec.Rules {
if rule.Visibility == visibility {
if rule.Hosts == nil || len(rule.Hosts) == 0 {
if len(rule.Hosts) == 0 {
return ingressTLS
}

Expand Down
4 changes: 2 additions & 2 deletions vendor/knative.dev/networking/pkg/certificates/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import "strings"
const (
Organization = "knative.dev"

// nolint:all
//nolint:all
LegacyFakeDnsName = "data-plane." + Organization

// nolint:all
//nolint:all
// Deprecated: FakeDnsName is deprecated.
// Please use the DataPlaneRoutingSAN for calls to the Activator
// and the DataPlaneUserSAN function for calls to a Knative-Service via Queue-Proxy.
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/networking/pkg/deprecated_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const (
// different user-agent. So we augment the probes with this header.
//
// Deprecated: use knative.dev/networking/pkg/http/header.KubeletProbeKey
KubeletProbeHeaderName = header.KubeletProbeKey
KubeletProbeHeaderName = header.KubeletProbeKey //nolint:staticheck

// UserAgentKey is the constant for header "User-Agent".
//
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/networking/pkg/http/header/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const (
// Prior to this deprecation, Istio with mTLS rewrote probes and their probes passed a
// different user-agent. Therefore, this header was added to augment the probes.
//
// Deprecated: this custom request header is no longer necessary since Istio now propagates the
// This custom request header is no longer necessary since Istio now propagates the
// original request header `User-Agent` sent by the kubelet (e.g., User-Agent: kube-probe/1.29).
// For updated usage, please utilize knative.dev/networking/pkg/http/header.UserAgentKey and
// knative.dev/networking/pkg/http/header.KubeProbeUAPrefix
Expand Down
3 changes: 2 additions & 1 deletion vendor/knative.dev/networking/pkg/ingress/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package ingress

import (
"crypto/sha256"
"encoding/hex"
"encoding/json"
"fmt"
"strings"
Expand Down Expand Up @@ -46,7 +47,7 @@ func InsertProbe(ing *v1alpha1.Ingress) (string, error) {
if err != nil {
return "", fmt.Errorf("failed to compute the hash of the Ingress: %w", err)
}
hash := fmt.Sprintf("%x", bytes)
hash := hex.EncodeToString(bytes[:])

for _, rule := range ing.Spec.Rules {
if rule.HTTP == nil {
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/pkg/apis/testing/roundtrip/roundtrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func ExternalTypesViaHub(t *testing.T, scheme, hubs *runtime.Scheme, fuzzerFuncs
continue
}

if reflect.PtrTo(objType).AssignableTo(metaV1ListType) {
if reflect.PointerTo(objType).AssignableTo(metaV1ListType) {
continue
}

Expand Down
6 changes: 3 additions & 3 deletions vendor/knative.dev/pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,15 @@ type ControllerOptions struct {
WorkQueueName string
Logger *zap.SugaredLogger
Reporter StatsReporter
RateLimiter workqueue.RateLimiter
RateLimiter workqueue.TypedRateLimiter[any]
Concurrency int
}

// NewContext instantiates an instance of our controller that will feed work to the
// provided Reconciler as it is enqueued.
func NewContext(ctx context.Context, r Reconciler, options ControllerOptions) *Impl {
if options.RateLimiter == nil {
options.RateLimiter = workqueue.DefaultControllerRateLimiter()
options.RateLimiter = workqueue.DefaultTypedControllerRateLimiter[any]()
}
if options.Reporter == nil {
options.Reporter = MustNewStatsReporter(options.WorkQueueName, options.Logger)
Expand All @@ -263,7 +263,7 @@ func NewContext(ctx context.Context, r Reconciler, options ControllerOptions) *I
}

// WorkQueue permits direct access to the work queue.
func (c *Impl) WorkQueue() workqueue.RateLimitingInterface {
func (c *Impl) WorkQueue() workqueue.TypedRateLimitingInterface[any] {
return c.workQueue
}

Expand Down
20 changes: 10 additions & 10 deletions vendor/knative.dev/pkg/controller/two_lane_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import "k8s.io/client-go/util/workqueue"
// -- slow queue (slowLane queue), whose contents are processed if fast queue has no items.
// All the default methods operate on the fast queue, unless noted otherwise.
type twoLaneQueue struct {
workqueue.RateLimitingInterface
slowLane workqueue.RateLimitingInterface
workqueue.TypedRateLimitingInterface[any]
slowLane workqueue.TypedRateLimitingInterface[any]
// consumerQueue is necessary to ensure that we're not reconciling
// the same object at the exact same time (e.g. if it had been enqueued
// in both fast and slow and is the only object there).
consumerQueue workqueue.Interface
consumerQueue workqueue.TypedInterface[any]

name string

Expand All @@ -37,9 +37,9 @@ type twoLaneQueue struct {
}

// Creates a new twoLaneQueue.
func newTwoLaneWorkQueue(name string, rl workqueue.RateLimiter) *twoLaneQueue {
func newTwoLaneWorkQueue(name string, rl workqueue.TypedRateLimiter[any]) *twoLaneQueue {
tlq := &twoLaneQueue{
RateLimitingInterface: workqueue.NewNamedRateLimitingQueue(
TypedRateLimitingInterface: workqueue.NewNamedRateLimitingQueue(
rl,
name+"-fast",
),
Expand All @@ -55,12 +55,12 @@ func newTwoLaneWorkQueue(name string, rl workqueue.RateLimiter) *twoLaneQueue {
// Run consumer thread.
go tlq.runConsumer()
// Run producer threads.
go process(tlq.RateLimitingInterface, tlq.fastChan)
go process(tlq.TypedRateLimitingInterface, tlq.fastChan)
go process(tlq.slowLane, tlq.slowChan)
return tlq
}

func process(q workqueue.Interface, ch chan interface{}) {
func process(q workqueue.TypedInterface[any], ch chan interface{}) {
// Sender closes the channel
defer close(ch)
for {
Expand Down Expand Up @@ -125,7 +125,7 @@ func (tlq *twoLaneQueue) runConsumer() {
// Shutdown implements workqueue.Interface.
// Shutdown shuts down both queues.
func (tlq *twoLaneQueue) ShutDown() {
tlq.RateLimitingInterface.ShutDown()
tlq.TypedRateLimitingInterface.ShutDown()
tlq.slowLane.ShutDown()
}

Expand All @@ -147,10 +147,10 @@ func (tlq *twoLaneQueue) Get() (interface{}, bool) {
// Len returns the sum of lengths.
// NB: actual _number_ of unique object might be less than this sum.
func (tlq *twoLaneQueue) Len() int {
return tlq.RateLimitingInterface.Len() + tlq.slowLane.Len() + tlq.consumerQueue.Len()
return tlq.TypedRateLimitingInterface.Len() + tlq.slowLane.Len() + tlq.consumerQueue.Len()
}

// SlowLane gives direct access to the slow queue.
func (tlq *twoLaneQueue) SlowLane() workqueue.RateLimitingInterface {
func (tlq *twoLaneQueue) SlowLane() workqueue.TypedRateLimitingInterface[any] {
return tlq.slowLane
}
22 changes: 11 additions & 11 deletions vendor/knative.dev/pkg/hash/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (

// universe represents the possible range of angles [0, universe).
// We want to have universe divide total range evenly to reduce bias.
universe = (1 << 11)
universe uint64 = (1 << 11)
)

// computeAngle returns a uint64 number which represents
Expand All @@ -51,13 +51,13 @@ func computeHash(n []byte, h hash.Hash64) uint64 {

type hashData struct {
// The set of all hashes for fast lookup and to name mapping
nameLookup map[int]string
nameLookup map[uint64]string
// Sorted set of hashes for selection algorithm.
hashPool []int
hashPool []uint64
// start angle
start int
start uint64
// step angle
step int
step uint64
}

func (hd *hashData) fromIndexSet(s sets.Set[int]) sets.Set[string] {
Expand Down Expand Up @@ -85,29 +85,29 @@ func buildHashes(in sets.Set[string], target string) *hashData {
buf.WriteString(startSalt)
hasher := fnv.New64a()
hd := &hashData{
nameLookup: make(map[int]string, len(from)),
hashPool: make([]int, len(from)),
start: int(computeHash(buf.Bytes(), hasher) % universe),
nameLookup: make(map[uint64]string, len(from)),
hashPool: make([]uint64, len(from)),
start: computeHash(buf.Bytes(), hasher) % universe,
}
buf.Truncate(len(target)) // Discard the angle salt.
buf.WriteString(stepSalt)
hd.step = int(computeHash(buf.Bytes(), hasher) % universe)
hd.step = computeHash(buf.Bytes(), hasher) % universe

for i, f := range from {
buf.Reset() // This retains the storage.
// Make unique sets for every target.
buf.WriteString(f)
buf.WriteString(target)
h := computeHash(buf.Bytes(), hasher)
hs := int(h % universe)
hs := h % universe
// Two values slotted to the same bucket.
// On average should happen with 1/universe probability.
_, ok := hd.nameLookup[hs]
for ok {
// Feed the hash as salt.
buf.WriteString(strconv.FormatUint(h, 16 /*append hex strings for shortness*/))
h = computeHash(buf.Bytes(), hasher)
hs = int(h % universe)
hs = h % universe
_, ok = hd.nameLookup[hs]
}

Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/pkg/metrics/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func prometheusPort() (int, error) {
return defaultPrometheusPort, nil
}

pp, err := strconv.ParseUint(ppStr, 10, 16)
pp, err := strconv.ParseInt(ppStr, 10, 16)
if err != nil {
return -1, fmt.Errorf("the environment variable %q could not be parsed as a port number: %w",
prometheusPortEnvName, err)
Expand Down
Loading

0 comments on commit 65de262

Please sign in to comment.