Skip to content

Commit

Permalink
fix: return proper value from Bridge.STP instead of plain nil
Browse files Browse the repository at this point in the history
Since we are returning interfaces in config, we have to return something typed for method chaining to work. Otherwise,
it simply doesn't know what method to call because there is no type information. We also don't want to change
the default config behavior, so we don't try to check for `nil` after calling `.STP()`.

Closes #8626

Signed-off-by: Dmitriy Matrenichev <[email protected]>
  • Loading branch information
DmitriyMV committed Apr 22, 2024
1 parent bac1d00 commit d460328
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/machinery/config/types/v1alpha1/v1alpha1_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ func (b *Bridge) Interfaces() []string {
// STP implements the config.Bridge interface.
func (b *Bridge) STP() config.STP {
if b.BridgeSTP == nil {
return nil
return (*STP)(nil)
}

return b.BridgeSTP
Expand Down

0 comments on commit d460328

Please sign in to comment.