Skip to content

Commit

Permalink
fix: et v1beta3 does not have broker set by default (#8079)
Browse files Browse the repository at this point in the history
* fix: et v1beta3 does not have broker set by default

Signed-off-by: Calum Murray <[email protected]>

* fix(text): unit tests no longer expect default broker

Signed-off-by: Calum Murray <[email protected]>

* cleanup: test name reflects new behaviour of allowing nil references

Signed-off-by: Calum Murray <[email protected]>

---------

Signed-off-by: Calum Murray <[email protected]>
  • Loading branch information
Cali0707 authored Jul 9, 2024
1 parent 8e7c775 commit 768f1bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
3 changes: 0 additions & 3 deletions pkg/apis/eventing/v1beta1/eventtype_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ func (et *EventType) SetDefaults(ctx context.Context) {
}

func (ets *EventTypeSpec) SetDefaults(ctx context.Context) {
if ets.Reference == nil && ets.Broker == "" {
ets.Broker = "default"
}
if ets.Reference != nil {
ets.Reference.SetDefaults(ctx)
}
Expand Down
8 changes: 2 additions & 6 deletions pkg/apis/eventing/v1beta1/eventtype_defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ func TestEventTypeDefaults(t *testing.T) {
"nil spec": {
initial: EventType{},
expected: EventType{
Spec: EventTypeSpec{
Broker: "default",
},
Spec: EventTypeSpec{},
},
},
"broker empty": {
"default broker reference": {
initial: EventType{
Spec: EventTypeSpec{
Type: "test-type",
Expand All @@ -53,7 +51,6 @@ func TestEventTypeDefaults(t *testing.T) {
Spec: EventTypeSpec{
Type: "test-type",
Source: testSource,
Broker: "default",
Schema: testSchema,
},
},
Expand All @@ -70,7 +67,6 @@ func TestEventTypeDefaults(t *testing.T) {
Spec: EventTypeSpec{
Type: "test-type",
Source: testSource,
Broker: "default",
Schema: testSchema,
},
},
Expand Down

0 comments on commit 768f1bd

Please sign in to comment.