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]>
(cherry picked from commit d460328)
  • Loading branch information
DmitriyMV authored and smira committed Jul 22, 2024
1 parent 968eb5a commit 745257f
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 @@ -1036,7 +1036,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 745257f

Please sign in to comment.