From b2b0ac0b8d557523c53ce20cfb57c3d2ec65aa9e Mon Sep 17 00:00:00 2001 From: Knative Automation Date: Tue, 21 May 2024 01:36:54 +0000 Subject: [PATCH] upgrade to latest dependencies bumping knative.dev/pkg 11a3d46...4a9c38d: > 4a9c38d Update actions (# 3037) bumping knative.dev/eventing 3ea1900...15be248: > 15be248 CrossNamespace: Data Plane Changes for Broker Filter (# 7913) > 34f9e43 CrossNamespace: Control Plane Changes for Trigger (# 7889) > 308e6b6 SubjectAccessReviews resources correction (# 7925) > 9cdc7ba CrossNamespace: Update knsubscribe permissions (# 7926) > dbaaedc [main] Update actions (# 7923) bumping knative.dev/caching 2720a0e...69083fa: > 69083fa Update actions (# 866) bumping knative.dev/serving 0c301bb...3aa9210: > 3aa9210 Update net-kourier nightly (# 15219) > 0d0d1e0 Update net-gateway-api nightly (# 15218) > c9b17b2 Update net-istio nightly (# 15220) > 639f7aa Update net-istio nightly (# 15213) > 3b35f54 change private K8s service to be a headless service (# 15170) > f2c7238 Update actions (# 15215) > 985cf2b Update net-gateway-api nightly (# 15214) > 38e22f9 Update net-kourier nightly (# 15212) > 11792fc Update net-kourier nightly (# 15206) Signed-off-by: Knative Automation --- go.mod | 8 +++--- go.sum | 16 +++++------ .../eventing/pkg/apis/eventing/register.go | 5 ++++ .../eventing/pkg/crossnamespace/validation.go | 5 +++- .../pkg/reconciler/testing/v1/broker.go | 9 +++++++ .../pkg/reconciler/testing/v1/factory.go | 7 ++++- .../pkg/reconciler/testing/v1/trigger.go | 27 +++++++++++++++++++ vendor/modules.txt | 8 +++--- 8 files changed, 67 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index c2e382eee..799def73d 100644 --- a/go.mod +++ b/go.mod @@ -21,11 +21,11 @@ require ( k8s.io/client-go v0.29.2 k8s.io/code-generator v0.29.2 k8s.io/utils v0.0.0-20240102154912-e7106e64919e - knative.dev/caching v0.0.0-20240515133240-2720a0e9c90f - knative.dev/eventing v0.41.1-0.20240515150746-3ea1900d3cab + knative.dev/caching v0.0.0-20240516131342-69083faf77fc + knative.dev/eventing v0.41.1-0.20240517185815-15be248b8a13 knative.dev/hack v0.0.0-20240507013718-68e3bfb39d11 - knative.dev/pkg v0.0.0-20240515073057-11a3d46fe4d6 - knative.dev/serving v0.41.1-0.20240515151825-0c301bba7903 + knative.dev/pkg v0.0.0-20240516194901-4a9c38d654dc + knative.dev/serving v0.41.1-0.20240517182722-3aa9210a0d13 sigs.k8s.io/yaml v1.4.0 ) diff --git a/go.sum b/go.sum index 38319a18d..272cdb4d2 100644 --- a/go.sum +++ b/go.sum @@ -1357,18 +1357,18 @@ k8s.io/utils v0.0.0-20200912215256-4140de9c8800/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -knative.dev/caching v0.0.0-20240515133240-2720a0e9c90f h1:pNGcPyu0bBfVumd3W8yYm7rvH/zJPwJbXHLiYmGW5Ks= -knative.dev/caching v0.0.0-20240515133240-2720a0e9c90f/go.mod h1:ExMA0ZLLFh7jDSVjFvS55CFCkiKfiqJxdP2A9OoQhGE= -knative.dev/eventing v0.41.1-0.20240515150746-3ea1900d3cab h1:F6zqcGPaGiaZJYCGN6gN5BOCAgrM+y2WhfHCOJaKMBo= -knative.dev/eventing v0.41.1-0.20240515150746-3ea1900d3cab/go.mod h1:bVJEkZeKJwCTFn/fh01DpaYknn8JsxeaDSQ/htciKKs= +knative.dev/caching v0.0.0-20240516131342-69083faf77fc h1:lHETLEA/8O599yQEe0qSJgYGUySwwiRcBvge1bl3eRg= +knative.dev/caching v0.0.0-20240516131342-69083faf77fc/go.mod h1:ExMA0ZLLFh7jDSVjFvS55CFCkiKfiqJxdP2A9OoQhGE= +knative.dev/eventing v0.41.1-0.20240517185815-15be248b8a13 h1:FI3fqbxBscE4lbdYSDwR38CAzbfxSzx9ZRqDsvBtSYg= +knative.dev/eventing v0.41.1-0.20240517185815-15be248b8a13/go.mod h1:bVJEkZeKJwCTFn/fh01DpaYknn8JsxeaDSQ/htciKKs= knative.dev/hack v0.0.0-20240507013718-68e3bfb39d11 h1:CYoD72R8/R35REjeY2nnWfBak+Q3f+NxXwEfwcID1eU= knative.dev/hack v0.0.0-20240507013718-68e3bfb39d11/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= knative.dev/networking v0.0.0-20240513222801-b31855c61440 h1:7IqK8QSnH33mKs87wVchyoZfgc1PL1Vpq3MGci+9iqk= knative.dev/networking v0.0.0-20240513222801-b31855c61440/go.mod h1:MBz3Bf4fqTscNAgFuUWkCo36ULDCBiJ8F2OgBMGoVJ0= -knative.dev/pkg v0.0.0-20240515073057-11a3d46fe4d6 h1:mUZ3ZrZFIfHtaILKPodBX1WnFQVpVSdA+e0DaUqIe30= -knative.dev/pkg v0.0.0-20240515073057-11a3d46fe4d6/go.mod h1:fkgcK/71v1QSJza7pCOxtuk7zSsWYPQ7eiuX8M2wXxs= -knative.dev/serving v0.41.1-0.20240515151825-0c301bba7903 h1:are7DyuIdGcrEf9LQrklNrJB1WD05wImNVO8qoyOaBE= -knative.dev/serving v0.41.1-0.20240515151825-0c301bba7903/go.mod h1:Md1/8Ay9/6/XjtDWRJ2AQ4ElgOGmBtOqy2G1alQAc28= +knative.dev/pkg v0.0.0-20240516194901-4a9c38d654dc h1:aiFq7jcBYaZlPxJkbJSNOg9Azcbgfu8dCrh2a/pkdN0= +knative.dev/pkg v0.0.0-20240516194901-4a9c38d654dc/go.mod h1:fkgcK/71v1QSJza7pCOxtuk7zSsWYPQ7eiuX8M2wXxs= +knative.dev/serving v0.41.1-0.20240517182722-3aa9210a0d13 h1:D6AOVdO+c7EMqcZpZbNcciO5ZUv7RIh4XIjlatVao7k= +knative.dev/serving v0.41.1-0.20240517182722-3aa9210a0d13/go.mod h1:Md1/8Ay9/6/XjtDWRJ2AQ4ElgOGmBtOqy2G1alQAc28= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/register.go b/vendor/knative.dev/eventing/pkg/apis/eventing/register.go index bc599aaac..ae699f239 100644 --- a/vendor/knative.dev/eventing/pkg/apis/eventing/register.go +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/register.go @@ -84,6 +84,11 @@ const ( // annotation key used to specify the name of the channel for // the triggers to subscribe to. BrokerChannelNameStatusAnnotationKey = "knative.dev/channelName" + + // BrokerChannelNamespaceStatusAnnotationKey is the broker status + // annotation key used to specify the namespace of the channel for + // the triggers to subscribe to. + BrokerChannelNamespaceStatusAnnotationKey = "knative.dev/channelNamespace" ) var ( diff --git a/vendor/knative.dev/eventing/pkg/crossnamespace/validation.go b/vendor/knative.dev/eventing/pkg/crossnamespace/validation.go index 9a0d173bc..c7be092e1 100644 --- a/vendor/knative.dev/eventing/pkg/crossnamespace/validation.go +++ b/vendor/knative.dev/eventing/pkg/crossnamespace/validation.go @@ -49,6 +49,9 @@ func CheckNamespace(ctx context.Context, r ResourceInfo) *apis.FieldError { return nil } + // convert the kind (Broker or Channel) into a resource (brokers or channels) + targetResource := strings.ToLower(targetKind) + "s" + // GetUserInfo accesses the UserInfo attached to the webhook context. userInfo := apis.GetUserInfo(ctx) if userInfo == nil { @@ -66,7 +69,7 @@ func CheckNamespace(ctx context.Context, r ResourceInfo) *apis.FieldError { Namespace: targetNamespace, Verb: "knsubscribe", Group: targetGroup, - Resource: targetKind, + Resource: targetResource, } // Create the SubjectAccessReview diff --git a/vendor/knative.dev/eventing/pkg/reconciler/testing/v1/broker.go b/vendor/knative.dev/eventing/pkg/reconciler/testing/v1/broker.go index 4677c628d..d7ddbd31c 100644 --- a/vendor/knative.dev/eventing/pkg/reconciler/testing/v1/broker.go +++ b/vendor/knative.dev/eventing/pkg/reconciler/testing/v1/broker.go @@ -225,6 +225,15 @@ func WithChannelNameAnnotation(name string) BrokerOption { } } +func WithChannelNamespaceAnnotation(namespace string) BrokerOption { + return func(b *v1.Broker) { + if b.Status.Annotations == nil { + b.Status.Annotations = make(map[string]string, 1) + } + b.Status.Annotations[eventing.BrokerChannelNamespaceStatusAnnotationKey] = namespace + } +} + func WithDeadLeaderSink(d duckv1.Destination) BrokerOption { return func(b *v1.Broker) { if b.Spec.Delivery == nil { diff --git a/vendor/knative.dev/eventing/pkg/reconciler/testing/v1/factory.go b/vendor/knative.dev/eventing/pkg/reconciler/testing/v1/factory.go index 9adf64207..0481c6cdf 100644 --- a/vendor/knative.dev/eventing/pkg/reconciler/testing/v1/factory.go +++ b/vendor/knative.dev/eventing/pkg/reconciler/testing/v1/factory.go @@ -20,6 +20,7 @@ import ( "context" "encoding/json" "slices" + "strings" "testing" authv1 "k8s.io/api/authorization/v1" @@ -136,8 +137,12 @@ func MakeFactory(ctor Ctor, unstructured bool, logger *zap.SugaredLogger) Factor continue } for _, rule := range role.Rules { + resources := make([]string, 0, len(rule.Resources)) + for _, resource := range rule.Resources { + resources = append(resources, strings.ToLower(resource)) + } if slices.Contains(rule.APIGroups, sar.Spec.ResourceAttributes.Group) && - (slices.Contains(rule.Resources, "*") || slices.Contains(rule.Resources, sar.Spec.ResourceAttributes.Resource)) && + (slices.Contains(rule.Resources, "*") || slices.Contains(resources, strings.ToLower(sar.Spec.ResourceAttributes.Resource))) && slices.Contains(rule.Verbs, sar.Spec.ResourceAttributes.Verb) { res := sar.DeepCopy() res.Status.Allowed = true diff --git a/vendor/knative.dev/eventing/pkg/reconciler/testing/v1/trigger.go b/vendor/knative.dev/eventing/pkg/reconciler/testing/v1/trigger.go index 0011ee787..24678e82c 100644 --- a/vendor/knative.dev/eventing/pkg/reconciler/testing/v1/trigger.go +++ b/vendor/knative.dev/eventing/pkg/reconciler/testing/v1/trigger.go @@ -54,6 +54,22 @@ func NewTrigger(name, namespace, broker string, to ...TriggerOption) *v1.Trigger return t } +func NewTriggerWithBrokerRef(name, namespace string, to ...TriggerOption) *v1.Trigger { + t := &v1.Trigger{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: namespace, + }, + } + + for _, opt := range to { + opt(t) + } + + t.SetDefaults(context.Background()) + return t +} + func WithTriggerSubscriberURI(rawurl string) TriggerOption { uri, _ := apis.ParseURL(rawurl) return func(t *v1.Trigger) { @@ -163,6 +179,17 @@ func WithTriggerBrokerUnknown(reason, message string) TriggerOption { } } +func WithTriggerBrokerRef(gvk metav1.GroupVersionKind, name string, namespace string) TriggerOption { + return func(t *v1.Trigger) { + t.Spec.BrokerRef = &duckv1.KReference{ + APIVersion: apiVersion(gvk), + Kind: gvk.Kind, + Name: name, + Namespace: namespace, + } + } +} + func WithTriggerNotSubscribed(reason, message string) TriggerOption { return func(t *v1.Trigger) { t.Status.MarkNotSubscribed(reason, message) diff --git a/vendor/modules.txt b/vendor/modules.txt index d6bec3f22..e6706ffcd 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1315,11 +1315,11 @@ k8s.io/utils/pointer k8s.io/utils/ptr k8s.io/utils/strings/slices k8s.io/utils/trace -# knative.dev/caching v0.0.0-20240515133240-2720a0e9c90f +# knative.dev/caching v0.0.0-20240516131342-69083faf77fc ## explicit; go 1.21 knative.dev/caching/pkg/apis/caching knative.dev/caching/pkg/apis/caching/v1alpha1 -# knative.dev/eventing v0.41.1-0.20240515150746-3ea1900d3cab +# knative.dev/eventing v0.41.1-0.20240517185815-15be248b8a13 ## explicit; go 1.21 knative.dev/eventing/pkg/apis/config knative.dev/eventing/pkg/apis/duck @@ -1435,7 +1435,7 @@ knative.dev/networking/pkg/http/proxy knative.dev/networking/pkg/http/stats knative.dev/networking/pkg/ingress knative.dev/networking/pkg/k8s -# knative.dev/pkg v0.0.0-20240515073057-11a3d46fe4d6 +# knative.dev/pkg v0.0.0-20240516194901-4a9c38d654dc ## explicit; go 1.21 knative.dev/pkg/apiextensions/storageversion knative.dev/pkg/apiextensions/storageversion/cmd/migrate @@ -1516,7 +1516,7 @@ knative.dev/pkg/webhook knative.dev/pkg/webhook/certificates knative.dev/pkg/webhook/certificates/resources knative.dev/pkg/webhook/resourcesemantics/conversion -# knative.dev/serving v0.41.1-0.20240515151825-0c301bba7903 +# knative.dev/serving v0.41.1-0.20240517182722-3aa9210a0d13 ## explicit; go 1.21 knative.dev/serving/pkg/apis/autoscaling knative.dev/serving/pkg/apis/autoscaling/v1alpha1