From d460328210ee3beea1b98ea5f23fcda5c2e2fd44 Mon Sep 17 00:00:00 2001 From: Dmitriy Matrenichev Date: Mon, 22 Apr 2024 11:24:05 +0300 Subject: [PATCH] fix: return proper value from Bridge.STP instead of plain nil 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 --- pkg/machinery/config/types/v1alpha1/v1alpha1_provider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/machinery/config/types/v1alpha1/v1alpha1_provider.go b/pkg/machinery/config/types/v1alpha1/v1alpha1_provider.go index 8e0b1e393d..5d17e101ae 100644 --- a/pkg/machinery/config/types/v1alpha1/v1alpha1_provider.go +++ b/pkg/machinery/config/types/v1alpha1/v1alpha1_provider.go @@ -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