Skip to content

Commit

Permalink
fix: fix the failing tests
Browse files Browse the repository at this point in the history
Signed-off-by: Leo Li <leoli@redhat.com>
  • Loading branch information
Leo6Leo committed May 10, 2024
1 parent fcf9916 commit 606578c
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions pkg/apis/eventing/v1/broker_defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,35 @@ var (
},
},
},
"customns": {
DefaultBrokerClass: "MTChannelBasedBroker",
BrokerConfig: &config.BrokerConfig{
KReference: &duckv1.KReference{
APIVersion: "v1",
Kind: "ConfigMap",
Namespace: "haha-ns",
Name: "haha-config",
},
},
BrokerClasses: map[string]*config.BrokerConfig{
"mynamespaceclass": {
KReference: &duckv1.KReference{
APIVersion: "v1",
Kind: "ConfigMap",
Namespace: "knative-eventing",
Name: "kafka-channel",
},
},
"mynamespaceclass2": {
KReference: &duckv1.KReference{
APIVersion: "v1",
Kind: "ConfigMap",
Namespace: "knative-eventing",
Name: "kafka-channel",
},
},
},
},
"custom": {
DefaultBrokerClass: "haha-broker",
BrokerConfig: &config.BrokerConfig{
Expand Down Expand Up @@ -476,7 +505,7 @@ func TestBrokerSetDefaults(t *testing.T) {
},
"missing deadLetterSink.ref.namespace, defaulted": {
initial: Broker{
ObjectMeta: metav1.ObjectMeta{Name: "broker", Namespace: "custom"},
ObjectMeta: metav1.ObjectMeta{Name: "broker", Namespace: "customns"},
Spec: BrokerSpec{
Config: &duckv1.KReference{
Kind: "ConfigMap",
Expand All @@ -501,7 +530,7 @@ func TestBrokerSetDefaults(t *testing.T) {
expected: Broker{
ObjectMeta: metav1.ObjectMeta{
Name: "broker",
Namespace: "custom",
Namespace: "customns",
Annotations: map[string]string{
eventing.BrokerClassKey: "MTChannelBasedBroker",
},
Expand All @@ -517,7 +546,7 @@ func TestBrokerSetDefaults(t *testing.T) {
DeadLetterSink: &duckv1.Destination{
Ref: &duckv1.KReference{
Kind: "Service",
Namespace: "custom",
Namespace: "customns",
Name: "handle-error",
APIVersion: "serving.knative.dev/v1",
},
Expand Down

0 comments on commit 606578c

Please sign in to comment.