[PR #6748] [client] preserve custom service name on upgrades #29860

Open
opened 2026-08-05 08:09:11 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/6748
Author: @CoderSufiyan
Created: 7/13/2026
Status: 🔄 Open

Base: mainHead: fix/issue-5711-custom-service-upgrade


📝 Commits (3)

  • 6bacbc0 [idp] add groups to default OIDC scopes for generic providers
  • be9825a [client] preserve custom service name on upgrades
  • eaa21b7 [client] Restore service test globals

📊 Changes

5 files changed (+60 additions, -3 deletions)

View changed files

📝 client/cmd/service_installer.go (+4 -0)
📝 client/cmd/service_params.go (+6 -0)
📝 client/cmd/service_params_test.go (+48 -1)
📝 idp/dex/config.go (+1 -1)
📝 idp/dex/connector.go (+1 -1)

📄 Description

Problem
Package upgrades invoke netbird service uninstall without the custom --service name, so a custom systemd unit remains running and the upgrade installs a second default netbird unit.

Solution
Persist the service name with the other install parameters and apply saved parameters during uninstall. This makes package upgrades remove and recreate the configured custom unit. Explicit --service flags still take precedence.

Documentation

  • Documentation is not needed

This fixes persisted internal service configuration without changing the CLI interface.

Test
go test ./client/cmd -run TestServiceParams

Fixes #5711

Summary by CodeRabbit

  • New Features

    • Saved service settings now retain the selected service name and restore it when reused.
    • Explicitly provided service names continue to take precedence over saved settings.
    • OIDC connections now request the groups scope by default, improving group information availability across supported identity providers.
  • Bug Fixes

    • Uninstall operations now load existing service settings before proceeding, helping preserve the configured service context.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/6748 **Author:** [@CoderSufiyan](https://github.com/CoderSufiyan) **Created:** 7/13/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/issue-5711-custom-service-upgrade` --- ### 📝 Commits (3) - [`6bacbc0`](https://github.com/netbirdio/netbird/commit/6bacbc0efec4825067c4b3d2e96dbece9f82dcea) [idp] add groups to default OIDC scopes for generic providers - [`be9825a`](https://github.com/netbirdio/netbird/commit/be9825aa19a868cca8381db8197175397f871f01) [client] preserve custom service name on upgrades - [`eaa21b7`](https://github.com/netbirdio/netbird/commit/eaa21b7c74e5d134f07545166db0a7957ccd4f76) [client] Restore service test globals ### 📊 Changes **5 files changed** (+60 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `client/cmd/service_installer.go` (+4 -0) 📝 `client/cmd/service_params.go` (+6 -0) 📝 `client/cmd/service_params_test.go` (+48 -1) 📝 `idp/dex/config.go` (+1 -1) 📝 `idp/dex/connector.go` (+1 -1) </details> ### 📄 Description **Problem** Package upgrades invoke `netbird service uninstall` without the custom `--service` name, so a custom systemd unit remains running and the upgrade installs a second default `netbird` unit. **Solution** Persist the service name with the other install parameters and apply saved parameters during uninstall. This makes package upgrades remove and recreate the configured custom unit. Explicit `--service` flags still take precedence. **Documentation** - [x] Documentation is **not needed** This fixes persisted internal service configuration without changing the CLI interface. **Test** `go test ./client/cmd -run TestServiceParams` Fixes #5711 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Saved service settings now retain the selected service name and restore it when reused. * Explicitly provided service names continue to take precedence over saved settings. * OIDC connections now request the `groups` scope by default, improving group information availability across supported identity providers. * **Bug Fixes** * Uninstall operations now load existing service settings before proceeding, helping preserve the configured service context. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 08:09:11 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#29860