Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: return proper value from Bridge.STP instead of plain nil #8627

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

DmitriyMV
Copy link
Member

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

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 siderolabs#8626

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
Copy link
Member

@frezbo frezbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any other places that might need the fix too?

@DmitriyMV
Copy link
Member Author

@frezbo

any other places that might need the fix too?

Looks like in other places either don't use method chaining before checking for nil or we return proper objects from the method.

@DmitriyMV
Copy link
Member Author

/m

@talos-bot talos-bot merged commit d460328 into siderolabs:main Apr 22, 2024
18 checks passed
@DmitriyMV DmitriyMV deleted the fix-npe branch April 22, 2024 11:48
@smira smira mentioned this pull request May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backported
Status: Backported
Development

Successfully merging this pull request may close these issues.

Go Panic in LinkConfigController when attempting to add bridge
6 participants