From 65de262254af962a7e2fb8fc1d7e573f40522474 Mon Sep 17 00:00:00 2001 From: Knative Automation Date: Sun, 12 Jan 2025 23:41:19 -0500 Subject: [PATCH] upgrade to latest dependencies (#15683) 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 --- go.mod | 4 +- go.sum | 8 +-- .../apis/networking/metadata_validation.go | 24 ++++---- .../networking/pkg/apis/networking/ports.go | 6 +- .../networking/v1alpha1/domainclaim_types.go | 6 +- .../networking/v1alpha1/ingress_helpers.go | 4 +- .../networking/pkg/certificates/constants.go | 4 +- .../networking/pkg/deprecated_header.go | 2 +- .../networking/pkg/http/header/header.go | 2 +- .../networking/pkg/ingress/ingress.go | 3 +- .../pkg/apis/testing/roundtrip/roundtrip.go | 2 +- .../knative.dev/pkg/controller/controller.go | 6 +- .../pkg/controller/two_lane_queue.go | 20 +++---- vendor/knative.dev/pkg/hash/hash.go | 22 +++---- vendor/knative.dev/pkg/metrics/config.go | 2 +- vendor/knative.dev/pkg/metrics/memstats.go | 57 +++++++++++-------- vendor/modules.txt | 4 +- 17 files changed, 90 insertions(+), 86 deletions(-) diff --git a/go.mod b/go.mod index 6ac4eaeb0332..b06466ad0500 100644 --- a/go.mod +++ b/go.mod @@ -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 ) diff --git a/go.sum b/go.sum index 95e1d99821e0..c9b07de32b4c 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/vendor/knative.dev/networking/pkg/apis/networking/metadata_validation.go b/vendor/knative.dev/networking/pkg/apis/networking/metadata_validation.go index ff081dcd0bf9..3c57c4fa96c5 100644 --- a/vendor/knative.dev/networking/pkg/apis/networking/metadata_validation.go +++ b/vendor/knative.dev/networking/pkg/apis/networking/metadata_validation.go @@ -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 diff --git a/vendor/knative.dev/networking/pkg/apis/networking/ports.go b/vendor/knative.dev/networking/pkg/apis/networking/ports.go index 6bd1a65f2910..14c03312101a 100644 --- a/vendor/knative.dev/networking/pkg/apis/networking/ports.go +++ b/vendor/knative.dev/networking/pkg/apis/networking/ports.go @@ -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 { diff --git a/vendor/knative.dev/networking/pkg/apis/networking/v1alpha1/domainclaim_types.go b/vendor/knative.dev/networking/pkg/apis/networking/v1alpha1/domainclaim_types.go index df19f31d7222..352f9658d8a6 100644 --- a/vendor/knative.dev/networking/pkg/apis/networking/v1alpha1/domainclaim_types.go +++ b/vendor/knative.dev/networking/pkg/apis/networking/v1alpha1/domainclaim_types.go @@ -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 diff --git a/vendor/knative.dev/networking/pkg/apis/networking/v1alpha1/ingress_helpers.go b/vendor/knative.dev/networking/pkg/apis/networking/v1alpha1/ingress_helpers.go index f3e015b05279..fa77c3c6e40f 100644 --- a/vendor/knative.dev/networking/pkg/apis/networking/v1alpha1/ingress_helpers.go +++ b/vendor/knative.dev/networking/pkg/apis/networking/v1alpha1/ingress_helpers.go @@ -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 } diff --git a/vendor/knative.dev/networking/pkg/certificates/constants.go b/vendor/knative.dev/networking/pkg/certificates/constants.go index 53f9c048dd24..cdb8c2941475 100644 --- a/vendor/knative.dev/networking/pkg/certificates/constants.go +++ b/vendor/knative.dev/networking/pkg/certificates/constants.go @@ -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. diff --git a/vendor/knative.dev/networking/pkg/deprecated_header.go b/vendor/knative.dev/networking/pkg/deprecated_header.go index c2e98c2c31e1..ce7d3059d3ac 100644 --- a/vendor/knative.dev/networking/pkg/deprecated_header.go +++ b/vendor/knative.dev/networking/pkg/deprecated_header.go @@ -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". // diff --git a/vendor/knative.dev/networking/pkg/http/header/header.go b/vendor/knative.dev/networking/pkg/http/header/header.go index 143f8bedb24c..6a8265d6a5a9 100644 --- a/vendor/knative.dev/networking/pkg/http/header/header.go +++ b/vendor/knative.dev/networking/pkg/http/header/header.go @@ -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 diff --git a/vendor/knative.dev/networking/pkg/ingress/ingress.go b/vendor/knative.dev/networking/pkg/ingress/ingress.go index f1ffb88c447e..ec4825c70119 100644 --- a/vendor/knative.dev/networking/pkg/ingress/ingress.go +++ b/vendor/knative.dev/networking/pkg/ingress/ingress.go @@ -18,6 +18,7 @@ package ingress import ( "crypto/sha256" + "encoding/hex" "encoding/json" "fmt" "strings" @@ -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 { diff --git a/vendor/knative.dev/pkg/apis/testing/roundtrip/roundtrip.go b/vendor/knative.dev/pkg/apis/testing/roundtrip/roundtrip.go index 54493b02e246..271a5b109892 100644 --- a/vendor/knative.dev/pkg/apis/testing/roundtrip/roundtrip.go +++ b/vendor/knative.dev/pkg/apis/testing/roundtrip/roundtrip.go @@ -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 } diff --git a/vendor/knative.dev/pkg/controller/controller.go b/vendor/knative.dev/pkg/controller/controller.go index 152d837d6d6a..bb5ab347a1c3 100644 --- a/vendor/knative.dev/pkg/controller/controller.go +++ b/vendor/knative.dev/pkg/controller/controller.go @@ -228,7 +228,7 @@ type ControllerOptions struct { WorkQueueName string Logger *zap.SugaredLogger Reporter StatsReporter - RateLimiter workqueue.RateLimiter + RateLimiter workqueue.TypedRateLimiter[any] Concurrency int } @@ -236,7 +236,7 @@ type ControllerOptions struct { // 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) @@ -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 } diff --git a/vendor/knative.dev/pkg/controller/two_lane_queue.go b/vendor/knative.dev/pkg/controller/two_lane_queue.go index d3656285b830..86299c297544 100644 --- a/vendor/knative.dev/pkg/controller/two_lane_queue.go +++ b/vendor/knative.dev/pkg/controller/two_lane_queue.go @@ -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 @@ -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", ), @@ -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 { @@ -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() } @@ -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 } diff --git a/vendor/knative.dev/pkg/hash/hash.go b/vendor/knative.dev/pkg/hash/hash.go index ae2969acd292..e51b999e950e 100644 --- a/vendor/knative.dev/pkg/hash/hash.go +++ b/vendor/knative.dev/pkg/hash/hash.go @@ -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 @@ -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] { @@ -85,13 +85,13 @@ 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. @@ -99,7 +99,7 @@ func buildHashes(in sets.Set[string], target string) *hashData { 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] @@ -107,7 +107,7 @@ func buildHashes(in sets.Set[string], target string) *hashData { // 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] } diff --git a/vendor/knative.dev/pkg/metrics/config.go b/vendor/knative.dev/pkg/metrics/config.go index 9ed17ef6786d..6cea1b33a490 100644 --- a/vendor/knative.dev/pkg/metrics/config.go +++ b/vendor/knative.dev/pkg/metrics/config.go @@ -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) diff --git a/vendor/knative.dev/pkg/metrics/memstats.go b/vendor/knative.dev/pkg/metrics/memstats.go index d96a0f4bc5c3..ca090bba1f87 100644 --- a/vendor/knative.dev/pkg/metrics/memstats.go +++ b/vendor/knative.dev/pkg/metrics/memstats.go @@ -19,6 +19,7 @@ package metrics import ( "context" "log" + "math" "runtime" "time" @@ -379,76 +380,76 @@ func (msp *MemStatsProvider) Start(ctx context.Context, period time.Duration) { ms := runtime.MemStats{} runtime.ReadMemStats(&ms) if msp.Alloc != nil { - Record(ctx, msp.Alloc.M(int64(ms.Alloc))) + Record(ctx, msp.Alloc.M(safeint64(ms.Alloc))) } if msp.TotalAlloc != nil { - Record(ctx, msp.TotalAlloc.M(int64(ms.TotalAlloc))) + Record(ctx, msp.TotalAlloc.M(safeint64(ms.TotalAlloc))) } if msp.Sys != nil { - Record(ctx, msp.Sys.M(int64(ms.Sys))) + Record(ctx, msp.Sys.M(safeint64(ms.Sys))) } if msp.Lookups != nil { - Record(ctx, msp.Lookups.M(int64(ms.Lookups))) + Record(ctx, msp.Lookups.M(safeint64(ms.Lookups))) } if msp.Mallocs != nil { - Record(ctx, msp.Mallocs.M(int64(ms.Mallocs))) + Record(ctx, msp.Mallocs.M(safeint64(ms.Mallocs))) } if msp.Frees != nil { - Record(ctx, msp.Frees.M(int64(ms.Frees))) + Record(ctx, msp.Frees.M(safeint64(ms.Frees))) } if msp.HeapAlloc != nil { - Record(ctx, msp.HeapAlloc.M(int64(ms.HeapAlloc))) + Record(ctx, msp.HeapAlloc.M(safeint64(ms.HeapAlloc))) } if msp.HeapSys != nil { - Record(ctx, msp.HeapSys.M(int64(ms.HeapSys))) + Record(ctx, msp.HeapSys.M(safeint64(ms.HeapSys))) } if msp.HeapIdle != nil { - Record(ctx, msp.HeapIdle.M(int64(ms.HeapIdle))) + Record(ctx, msp.HeapIdle.M(safeint64(ms.HeapIdle))) } if msp.HeapInuse != nil { - Record(ctx, msp.HeapInuse.M(int64(ms.HeapInuse))) + Record(ctx, msp.HeapInuse.M(safeint64(ms.HeapInuse))) } if msp.HeapReleased != nil { - Record(ctx, msp.HeapReleased.M(int64(ms.HeapReleased))) + Record(ctx, msp.HeapReleased.M(safeint64(ms.HeapReleased))) } if msp.HeapObjects != nil { - Record(ctx, msp.HeapObjects.M(int64(ms.HeapObjects))) + Record(ctx, msp.HeapObjects.M(safeint64(ms.HeapObjects))) } if msp.StackInuse != nil { - Record(ctx, msp.StackInuse.M(int64(ms.StackInuse))) + Record(ctx, msp.StackInuse.M(safeint64(ms.StackInuse))) } if msp.StackSys != nil { - Record(ctx, msp.StackSys.M(int64(ms.StackSys))) + Record(ctx, msp.StackSys.M(safeint64(ms.StackSys))) } if msp.MSpanInuse != nil { - Record(ctx, msp.MSpanInuse.M(int64(ms.MSpanInuse))) + Record(ctx, msp.MSpanInuse.M(safeint64(ms.MSpanInuse))) } if msp.MSpanSys != nil { - Record(ctx, msp.MSpanSys.M(int64(ms.MSpanSys))) + Record(ctx, msp.MSpanSys.M(safeint64(ms.MSpanSys))) } if msp.MCacheInuse != nil { - Record(ctx, msp.MCacheInuse.M(int64(ms.MCacheInuse))) + Record(ctx, msp.MCacheInuse.M(safeint64(ms.MCacheInuse))) } if msp.MCacheSys != nil { - Record(ctx, msp.MCacheSys.M(int64(ms.MCacheSys))) + Record(ctx, msp.MCacheSys.M(safeint64(ms.MCacheSys))) } if msp.BuckHashSys != nil { - Record(ctx, msp.BuckHashSys.M(int64(ms.BuckHashSys))) + Record(ctx, msp.BuckHashSys.M(safeint64(ms.BuckHashSys))) } if msp.GCSys != nil { - Record(ctx, msp.GCSys.M(int64(ms.GCSys))) + Record(ctx, msp.GCSys.M(safeint64(ms.GCSys))) } if msp.OtherSys != nil { - Record(ctx, msp.OtherSys.M(int64(ms.OtherSys))) + Record(ctx, msp.OtherSys.M(safeint64(ms.OtherSys))) } if msp.NextGC != nil { - Record(ctx, msp.NextGC.M(int64(ms.NextGC))) + Record(ctx, msp.NextGC.M(safeint64(ms.NextGC))) } if msp.LastGC != nil { - Record(ctx, msp.LastGC.M(int64(ms.LastGC))) + Record(ctx, msp.LastGC.M(safeint64(ms.LastGC))) } if msp.PauseTotalNs != nil { - Record(ctx, msp.PauseTotalNs.M(int64(ms.PauseTotalNs))) + Record(ctx, msp.PauseTotalNs.M(safeint64(ms.PauseTotalNs))) } if msp.NumGC != nil { Record(ctx, msp.NumGC.M(int64(ms.NumGC))) @@ -549,3 +550,11 @@ func (msp *MemStatsProvider) DefaultViews() (views []*view.View) { } return } + +func safeint64(val uint64) int64 { + if val > math.MaxInt64 { + return math.MaxInt64 + } + + return int64(val) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 5a0690a835c7..ed3349f7b88e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1397,7 +1397,7 @@ knative.dev/caching/pkg/client/listers/caching/v1alpha1 # knative.dev/hack v0.0.0-20250109131303-f8be0ccdff36 ## explicit; go 1.21 knative.dev/hack -# knative.dev/networking v0.0.0-20250109151316-3fac3bb26e88 +# knative.dev/networking v0.0.0-20250110153017-22a6457498e8 ## explicit; go 1.22.7 knative.dev/networking/config knative.dev/networking/pkg @@ -1436,7 +1436,7 @@ knative.dev/networking/pkg/http/stats knative.dev/networking/pkg/ingress knative.dev/networking/pkg/k8s knative.dev/networking/pkg/prober -# knative.dev/pkg v0.0.0-20250109201817-83cd52ed87d9 +# knative.dev/pkg v0.0.0-20250110150618-accfe3649188 ## explicit; go 1.22.7 knative.dev/pkg/apiextensions/storageversion knative.dev/pkg/apiextensions/storageversion/cmd/migrate