Skip to content

Commit

Permalink
Switch broker DLQ test to use a k8s Service
Browse files Browse the repository at this point in the history
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 knative/eventing#5748 for the namespace
defaulting change
xref knative/eventing#5185 for more discussion of
the changed behavior of client-go fake dynamic clients.
  • Loading branch information
Ben Moss committed Sep 23, 2021
1 parent c944a0c commit 9a837cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/reconciler/broker/broker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const (

deadLetterSinkKind = "Service"
deadLetterSinkName = "badsink"
deadLetterSinkAPIVersion = "serving.knative.dev/v1"
deadLetterSinkAPIVersion = "v1"

dispatcherImage = "dispatcherimage"
)
Expand Down Expand Up @@ -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,
},
Expand Down

0 comments on commit 9a837cb

Please sign in to comment.