From 9a837cb286836bb6825600a8a6a143bbfda808cb Mon Sep 17 00:00:00 2001 From: Ben Moss Date: Thu, 23 Sep 2021 09:19:01 -0400 Subject: [PATCH] Switch broker DLQ test to use a k8s Service With upcoming changes to eventing DLQs will be defaulted to the namespace of their parent object if the namespace isn't specified in the ref. For some reason this causes a panic from the fake dynamic client that doesn't occur if the namespace isn't specified. It happens because ksvcs have been registered with the fake dynamic client as a type, but I'm not really sure why they only panic when a namespace is present. xref https://github.com/knative/eventing/pull/5748 for the namespace defaulting change xref https://github.com/knative/eventing/issues/5185 for more discussion of the changed behavior of client-go fake dynamic clients. --- pkg/reconciler/broker/broker_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/reconciler/broker/broker_test.go b/pkg/reconciler/broker/broker_test.go index e81e860e4b..1a3186b339 100644 --- a/pkg/reconciler/broker/broker_test.go +++ b/pkg/reconciler/broker/broker_test.go @@ -82,7 +82,7 @@ const ( deadLetterSinkKind = "Service" deadLetterSinkName = "badsink" - deadLetterSinkAPIVersion = "serving.knative.dev/v1" + deadLetterSinkAPIVersion = "v1" dispatcherImage = "dispatcherimage" ) @@ -968,13 +968,13 @@ func TestReconcile(t *testing.T) { WithBrokerDelivery(deliveryUnresolvableDeadLetterSink), WithIngressAvailable(), WithDLXReady(), - WithDeadLetterSinkFailed("Unable to get the DeadLetterSink's URI", `services.serving.knative.dev "badsink" not found`), + WithDeadLetterSinkFailed("Unable to get the DeadLetterSink's URI", `services "badsink" not found`), WithSecretReady(), WithBrokerAddressURI(brokerAddress), WithExchangeReady()), }}, WantEvents: []string{ - Eventf(corev1.EventTypeWarning, "InternalError", `services.serving.knative.dev "badsink" not found`), + Eventf(corev1.EventTypeWarning, "InternalError", `services "badsink" not found`), }, WantErr: true, },