mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-06 05:29:07 +02:00
Fix review
This commit is contained in:
@@ -843,6 +843,7 @@ func TestAddConfig_AllFieldsCovered(t *testing.T) {
|
||||
"PreSharedKey": "sensitive: WireGuard pre-shared key",
|
||||
"SSHKey": "sensitive: SSH private key",
|
||||
"ClientCertKeyPair": "non-config: parsed cert pair, not serialized",
|
||||
"Name": "non-config: profile name is not needed for debug purposes",
|
||||
}
|
||||
|
||||
mURL, _ := url.Parse("https://api.example.com:443")
|
||||
|
||||
@@ -442,7 +442,7 @@ func (s *ServiceManager) loadAllProfiles(username string) ([]Profile, error) {
|
||||
ID: defaultProfileName,
|
||||
Name: defaultProfileName,
|
||||
Path: DefaultConfigPath,
|
||||
IsActive: activeIsDefault || activeID == defaultProfileName,
|
||||
IsActive: activeIsDefault,
|
||||
}}
|
||||
|
||||
configDir, err := s.getConfigDir(username)
|
||||
@@ -487,7 +487,7 @@ func (s *ServiceManager) loadAllProfiles(username string) ([]Profile, error) {
|
||||
ID: stem,
|
||||
Name: name,
|
||||
Path: path,
|
||||
IsActive: stem == activeID && !activeIsDefault,
|
||||
IsActive: stem == activeID,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -131,16 +131,6 @@ func TestServiceProfile_LegacyFilenameCoexists(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestAddProfile_RejectsDuplicateNameByDefault(t *testing.T) {
|
||||
withTestSM(t, func(sm *ServiceManager, username string) {
|
||||
_, err := sm.AddProfile("work", username)
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = sm.AddProfile("work", username)
|
||||
assert.ErrorIs(t, err, ErrProfileAlreadyExists)
|
||||
})
|
||||
}
|
||||
|
||||
func TestAddProfile_AllowsDuplicateWithFlag(t *testing.T) {
|
||||
withTestSM(t, func(sm *ServiceManager, username string) {
|
||||
first, err := sm.AddProfile("work", username)
|
||||
|
||||
Reference in New Issue
Block a user