Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ require (
k8s.io/apimachinery v0.36.6
k8s.io/client-go v0.36.6
k8s.io/code-generator v0.36.6
knative.dev/eventing v0.51.1-0.20261127024105-6fcccf0d6157
knative.dev/eventing v0.51.1-0.20261127143708-70387156b345
knative.dev/hack v0.0.0-20261126142104-562bef61fc20
knative.dev/pkg v0.0.0-20261127102215-b69fc46e9c17
knative.dev/serving v0.51.1-0.20261127122206-c41d06b059b1
knative.dev/pkg v0.0.0-20261128164606-138f16908f04
knative.dev/serving v0.51.1-0.20261129192312-765a8351b65d
)

require (
Expand Down Expand Up @@ -123,7 +123,7 @@ require (
k8s.io/klog/v2 v2.140.0 // indirect
k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a // indirect
k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 // indirect
knative.dev/networking v0.0.0-20261124022803-b89db3dbd9b2 // indirect
knative.dev/networking v0.0.0-20261127011406-ea3541a92400 // indirect
sigs.k8s.io/gateway-api v1.5.0 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -376,16 +376,16 @@ k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a h1:xCeOEAOoGYl2jnJoHkC3hk
k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a/go.mod h1:uGBT7iTA6c6MvqUvSXIaYZo9ukscABYi2btjhvgKGZ0=
k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 h1:AZYQSJemyQB5eRxqcPky+/7EdBj0xi3g0ZcxxJ7vbWU=
k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk=
knative.dev/eventing v0.51.1-0.20261127024105-6fcccf0d6157 h1:QZGz8mwlT7Pz6qZ6iGP3F9RTlE7/XyXMmdvaBmZ/udo=
knative.dev/eventing v0.51.1-0.20261127024105-6fcccf0d6157/go.mod h1:PPHH/UcFC2yDKjxgA3mUoUGmdBBr0EN9dHsdRNo9Shs=
knative.dev/eventing v0.51.1-0.20261127143708-70387156b345 h1:qRWsno6OiwnhgJUWVF1BQor6ZCOE2R685zc3TS9AOw0=
knative.dev/eventing v0.51.1-0.20261127143708-70387156b345/go.mod h1:L4iuKlimJEsgrM4m4dW7pkzwx+OxmuveTpaTraqXMoQ=
knative.dev/hack v0.0.0-20261126142104-562bef61fc20 h1:55aJzNKyWEyc2wDlL2Ztg6rQDLXvjdKPEwRSo0dHZec=
knative.dev/hack v0.0.0-20261126142104-562bef61fc20/go.mod h1:L5RzHgbvam0u8QFHfzCX6MKxu/a/gIGEdaRBqNiVbl0=
knative.dev/networking v0.0.0-20261124022803-b89db3dbd9b2 h1:m8by4HhQKUwbBqwX7b1SbWP9JtnlVigSuWsWHNvXWsQ=
knative.dev/networking v0.0.0-20261124022803-b89db3dbd9b2/go.mod h1:dCq4J4YafAQ0nPCO5kAQuktxj26M90tJ0xZOI7d7Pmw=
knative.dev/pkg v0.0.0-20261127102215-b69fc46e9c17 h1:hlNn0qbeXN1JPpUq/gzkFl8Hg74amZYoysKZVQGBZx0=
knative.dev/pkg v0.0.0-20261127102215-b69fc46e9c17/go.mod h1:4FW3fLOhaPd+jTbD9iUjuzi0B5TIRMvMIf1B5PE8fR8=
knative.dev/serving v0.51.1-0.20261127122206-c41d06b059b1 h1:rKLibYZPBShOP0e8RYuyJXIuEgLJdavSoKjaX5zKwXQ=
knative.dev/serving v0.51.1-0.20261127122206-c41d06b059b1/go.mod h1:uiGSFSiqXFrPXYWdV6gF6Flj2irW2Si5M8YzH88qagA=
knative.dev/networking v0.0.0-20261127011406-ea3541a92400 h1:Rj9C6x3X0HnL4HA79ZmInsK85qCxU7JxI0wJK2MiGKs=
knative.dev/networking v0.0.0-20261127011406-ea3541a92400/go.mod h1:VgQiFfX6KVhZs4onC1OxB5A/jPVxR937mnqGasK/8AM=
knative.dev/pkg v0.0.0-20261128164606-138f16908f04 h1:MkiWZIrEUH5NpoBkgdp5xxqncslT0KAgXOQyskWgd64=
knative.dev/pkg v0.0.0-20261128164606-138f16908f04/go.mod h1:4FW3fLOhaPd+jTbD9iUjuzi0B5TIRMvMIf1B5PE8fR8=
knative.dev/serving v0.51.1-0.20261129192312-765a8351b65d h1:crL5MaczrHuC5M3X2Y5c60LETbP4jWvfXMr3FKA2zQ0=
knative.dev/serving v0.51.1-0.20261129192312-765a8351b65d/go.mod h1:ifEZtWXAtPr2S+V+IdXjr4l1drqL5Dcpa6ylpvh72/I=
sigs.k8s.io/gateway-api v1.5.0 h1:duoo14Ky/fJXpjpmyMISE2RTBGnfCg8zICfTYLTnBJA=
sigs.k8s.io/gateway-api v1.5.0/go.mod h1:GvCETiaMAlLym5CovLxGjS0NysqFk3+Yuq3/rh6QL2o=
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
Expand Down
11 changes: 11 additions & 0 deletions vendor/knative.dev/pkg/hash/bucketer.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ func (b *Bucket) Has(nn types.NamespacedName) bool {
return b.buckets.Owner(nn.String()) == b.name
}

// Bucket returns the bucket with the given name, if present.
func (bs *BucketSet) Bucket(name string) (reconciler.Bucket, bool) {
if !bs.HasBucket(name) {
return nil, false
}
return &Bucket{
name: name,
buckets: bs,
}, true
}

// Buckets creates a new list of all possible Bucket based on this bucketset
// ordered by bucket name.
func (bs *BucketSet) Buckets() []reconciler.Bucket {
Expand Down
9 changes: 6 additions & 3 deletions vendor/knative.dev/pkg/leaderelection/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,12 @@ func NewStatefulSetBucketAndSet(buckets int) (reconciler.Bucket, *hash.BucketSet
}

bs := hash.NewBucketSet(names)
// Buckets is sorted in order of names so we can use ordinal to
// get the correct Bucket for this binary.
return bs.Buckets()[ssc.StatefulSetID.ordinal], bs, nil
podDNS := statefulSetPodDNS(ssc.StatefulSetID.ordinal, ssc)
bkt, ok := bs.Bucket(podDNS)
if !ok {
return nil, nil, fmt.Errorf("no bucket for StatefulSet pod %q", podDNS)
}
return bkt, bs, nil
}

func statefulSetPodDNS(ordinal int, ssc *statefulSetConfig) string {
Expand Down
17 changes: 15 additions & 2 deletions vendor/knative.dev/pkg/leaderelection/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,21 @@ limitations under the License.
// https://github.com/knative/pkg/blob/main/injection/README.md
//
// Leaderelection uses the context-stuffing mechanism to provide config-driven
// management of multiple election strategies (currently, using Kubernetes
// etcd-based election primitives or StatefulSet indexes and counts).
// management of multiple election strategies using Kubernetes leader election
// primitives or StatefulSet pod ordinals.
//
// To run every replica in StatefulSet ordinal mode, use zero-based pod ordinals
// and keep the StatefulSet replica count equal to the configured bucket count
// when deploying or scaling. If there are fewer replicas than buckets, some
// buckets have no owner and reconciliation for objects assigned to them stalls.
// A replica whose ordinal is outside the configured bucket range cannot use
// ordinal mode. WithDynamicLeaderElectorBuilder falls back to Lease-based
// leader election for that replica, which can lead to duplicate reconciliation
// alongside replicas in ordinal mode. This package does not read the StatefulSet
// replica count. Controllers can check the desired replica count against the
// bucket count at startup. Matching the desired replica count does not guarantee
// that every bucket has an active owner; unavailable replicas leave their buckets
// unowned. A startup check detects configuration mismatches only at startup.
//
// For more details, see the original design document:
// https://docs.google.com/document/d/e/2PACX-1vTh40N-Kk6EPNzYpITiLg8YJk0qZyZv7KgMpcQS72T9Lv_F2PQeGybx4TtH0E1N1aUgLQer7b8u3lDc/pub
Expand Down
16 changes: 10 additions & 6 deletions vendor/knative.dev/pkg/observability/tracing/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"cmp"
"context"
"fmt"
"math"
"net/url"
"os"
"strconv"
Expand Down Expand Up @@ -63,14 +64,14 @@ func NewTracerProvider(
}, nil
}

exp, err := exporterFor(ctx, cfg)
sampler, err := sampleFor(cfg)
if err != nil {
return nil, fmt.Errorf("error creating tracer exporter: %w", err)
return nil, fmt.Errorf("error creating tracer sampler: %w", err)
}

sampler, err := sampleFor(cfg)
exp, err := exporterFor(ctx, cfg)
if err != nil {
return nil, fmt.Errorf("error creating tracer sampler: %w", err)
return nil, fmt.Errorf("error creating tracer exporter: %w", err)
}

opts = append(opts,
Expand Down Expand Up @@ -181,6 +182,9 @@ func sampleFor(cfg Config) (sdktrace.Sampler, error) {
if err != nil {
return nil, fmt.Errorf("unable to parse sample rate override: %w", err)
}
if math.IsNaN(override) {
return nil, fmt.Errorf("sample rate override %q is not a number", val)
}

rate = override
}
Expand All @@ -189,10 +193,10 @@ func sampleFor(cfg Config) (sdktrace.Sampler, error) {
return sdktrace.AlwaysSample(), nil
}

if cfg.SamplingRate <= 0.0 {
if rate <= 0.0 {
return sdktrace.NeverSample(), nil
}

root := sdktrace.TraceIDRatioBased(cfg.SamplingRate)
root := sdktrace.TraceIDRatioBased(rate)
return sdktrace.ParentBased(root), nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ func validateAlgorithm(m map[string]string) *apis.FieldError {

func validateFloats(m map[string]string) (errs *apis.FieldError) {
if k, v, ok := PanicWindowPercentageAnnotation.Get(m); ok {
if fv, err := strconv.ParseFloat(v, 64); err != nil {
if fv, err := strconv.ParseFloat(v, 64); err != nil || math.IsNaN(fv) {
errs = errs.Also(apis.ErrInvalidValue(v, k))
} else if fv < PanicWindowPercentageMin || fv > PanicWindowPercentageMax {
errs = apis.ErrOutOfBoundsValue(v, PanicWindowPercentageMin,
PanicWindowPercentageMax, k)
}
}
if k, v, ok := PanicThresholdPercentageAnnotation.Get(m); ok {
if fv, err := strconv.ParseFloat(v, 64); err != nil {
if fv, err := strconv.ParseFloat(v, 64); err != nil || math.IsNaN(fv) {
errs = errs.Also(apis.ErrInvalidValue(v, k))
} else if fv < PanicThresholdPercentageMin || fv > PanicThresholdPercentageMax {
errs = errs.Also(apis.ErrOutOfBoundsValue(v, PanicThresholdPercentageMin,
Expand All @@ -109,23 +109,23 @@ func validateFloats(m map[string]string) (errs *apis.FieldError) {
}

if k, v, ok := TargetAnnotation.Get(m); ok {
if fv, err := strconv.ParseFloat(v, 64); err != nil {
if fv, err := strconv.ParseFloat(v, 64); err != nil || math.IsNaN(fv) || math.IsInf(fv, 0) {
errs = errs.Also(apis.ErrInvalidValue(v, k))
} else if fv < TargetMin {
errs = errs.Also(apis.ErrGeneric(fmt.Sprintf("target %s should be at least %g", v, TargetMin), k))
}
}

if k, v, ok := TargetUtilizationPercentageAnnotation.Get(m); ok {
if fv, err := strconv.ParseFloat(v, 64); err != nil {
if fv, err := strconv.ParseFloat(v, 64); err != nil || math.IsNaN(fv) {
errs = errs.Also(apis.ErrInvalidValue(v, k))
} else if fv < 1 || fv > 100 {
errs = errs.Also(apis.ErrOutOfBoundsValue(v, 1, 100, k))
}
}

if k, v, ok := TargetBurstCapacityAnnotation.Get(m); ok {
if fv, err := strconv.ParseFloat(v, 64); err != nil || fv < 0 && fv != -1 {
if fv, err := strconv.ParseFloat(v, 64); err != nil || math.IsNaN(fv) || math.IsInf(fv, 0) || fv < 0 && fv != -1 {
errs = errs.Also(apis.ErrInvalidValue(v, k))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package v1
import (
"context"
"fmt"
"math"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -193,7 +194,7 @@ func validateQueueSidecarResourceAnnotations(m map[string]string) *apis.FieldErr
if k, v, ok := serving.QueueSidecarResourcePercentageAnnotation.Get(m); ok {
errs = apis.ErrGeneric("Queue proxy resource percentage annotation is deprecated. Please use the available annotations to explicitly set resource values per service").ViaKey(k).At(apis.WarningLevel)
value, err := strconv.ParseFloat(v, 64)
if err != nil {
if err != nil || math.IsNaN(value) {
errs = errs.Also(apis.ErrInvalidValue(v, apis.CurrentField).ViaKey(k))
} else if value < 0.1 || value > 100 {
errs = errs.Also(apis.ErrOutOfBoundsValue(value, 0.1, 100.0, apis.CurrentField).ViaKey(k))
Expand Down Expand Up @@ -236,7 +237,7 @@ func validateProgressDeadlineAnnotation(annos map[string]string) *apis.FieldErro
}
}
// And positive.
if d < 0 {
if d <= 0 {
return &apis.FieldError{
Message: fmt.Sprintf("progress-deadline=%s must be positive", v),
Paths: []string{k},
Expand Down
8 changes: 4 additions & 4 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ k8s.io/utils/net
k8s.io/utils/pointer
k8s.io/utils/ptr
k8s.io/utils/trace
# knative.dev/eventing v0.51.1-0.20261127024105-6fcccf0d6157
# knative.dev/eventing v0.51.1-0.20261127143708-70387156b345
## explicit; go 1.26.0
knative.dev/eventing/pkg/adapter/v2
knative.dev/eventing/pkg/adapter/v2/test
Expand Down Expand Up @@ -1233,12 +1233,12 @@ knative.dev/eventing/pkg/utils
# knative.dev/hack v0.0.0-20261126142104-562bef61fc20
## explicit; go 1.24
knative.dev/hack
# knative.dev/networking v0.0.0-20261124022803-b89db3dbd9b2
# knative.dev/networking v0.0.0-20261127011406-ea3541a92400
## explicit; go 1.26.0
knative.dev/networking/pkg/apis/networking
knative.dev/networking/pkg/apis/networking/v1alpha1
knative.dev/networking/pkg/config
# knative.dev/pkg v0.0.0-20261127102215-b69fc46e9c17
# knative.dev/pkg v0.0.0-20261128164606-138f16908f04
## explicit; go 1.26.0
knative.dev/pkg/apis
knative.dev/pkg/apis/duck
Expand Down Expand Up @@ -1317,7 +1317,7 @@ knative.dev/pkg/webhook/psbinding
knative.dev/pkg/webhook/resourcesemantics
knative.dev/pkg/webhook/resourcesemantics/defaulting
knative.dev/pkg/webhook/resourcesemantics/validation
# knative.dev/serving v0.51.1-0.20261127122206-c41d06b059b1
# knative.dev/serving v0.51.1-0.20261129192312-765a8351b65d
## explicit; go 1.26.0
knative.dev/serving/pkg/apis/autoscaling
knative.dev/serving/pkg/apis/autoscaling/v1alpha1
Expand Down
Loading