Skip to content

Conversation

@mlsmaycon
Copy link
Collaborator

Describe your changes

Issue ticket number and link

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses a bug fix to properly handle cases where the extended configuration is nil by ensuring that the updated Netbird configuration is correctly assigned after extending it.

  • In management/server/token_mgr.go, the extended configuration is now captured in a variable and then assigned back to update.NetbirdConfig.
  • In management/server/grpcserver.go, a similar approach is applied where the extended configuration is stored in a variable before being set on the response.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
management/server/token_mgr.go Assigns the returned extended configuration explicitly to update.NetbirdConfig
management/server/grpcserver.go Captures and assigns the extended configuration to response.NetbirdConfig
Comments suppressed due to low confidence (2)

management/server/token_mgr.go:261

  • [nitpick] Consider using a more descriptive variable name (e.g., 'updatedNetbirdConfig') to improve clarity, especially if this value is used in multiple contexts.
extendedConfig := integrationsConfig.ExtendNetBirdConfig(peerID, update.NetbirdConfig, extraSettings)

management/server/grpcserver.go:640

  • [nitpick] For consistency with similar changes in the codebase, consider renaming the variable to better reflect that it holds the updated Netbird configuration.
extendedConfig := integrationsConfig.ExtendNetBirdConfig(peer.ID, nbConfig, extraSettings)

@sonarqubecloud
Copy link

@mlsmaycon mlsmaycon merged commit 50f5cc4 into main Mar 27, 2025
33 checks passed
@mlsmaycon mlsmaycon deleted the fix/extended-config-when-nil branch March 27, 2025 22:07
remipcomaite pushed a commit to remipcomaite/netbird that referenced this pull request Apr 9, 2025
* Fix extended config when nil

* update integrations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants