[client]: Add config flag to service to override default profile path (#4276)

[client]: Add config flag to service to override default profile path (#4276)
This commit is contained in:
hakansa
2025-08-05 12:33:43 +03:00
committed by GitHub
parent 348d981b2c
commit 9ccc13e6ea
10 changed files with 36 additions and 14 deletions

View File

@@ -74,7 +74,7 @@ type Server struct {
persistNetworkMap bool
isSessionActive atomic.Bool
profileManager profilemanager.ServiceManager
profileManager *profilemanager.ServiceManager
profilesDisabled bool
}
@@ -86,13 +86,13 @@ type oauthAuthFlow struct {
}
// New server instance constructor.
func New(ctx context.Context, logFile string, profilesDisabled bool) *Server {
func New(ctx context.Context, logFile string, configFile string, profilesDisabled bool) *Server {
return &Server{
rootCtx: ctx,
logFile: logFile,
persistNetworkMap: true,
statusRecorder: peer.NewRecorder(""),
profileManager: profilemanager.ServiceManager{},
profileManager: profilemanager.NewServiceManager(configFile),
profilesDisabled: profilesDisabled,
}
}

View File

@@ -94,7 +94,7 @@ func TestConnectWithRetryRuns(t *testing.T) {
t.Fatalf("failed to set active profile state: %v", err)
}
s := New(ctx, "debug", false)
s := New(ctx, "debug", "", false)
s.config = config
@@ -151,7 +151,7 @@ func TestServer_Up(t *testing.T) {
t.Fatalf("failed to set active profile state: %v", err)
}
s := New(ctx, "console", false)
s := New(ctx, "console", "", false)
err = s.Start()
require.NoError(t, err)
@@ -227,7 +227,7 @@ func TestServer_SubcribeEvents(t *testing.T) {
t.Fatalf("failed to set active profile state: %v", err)
}
s := New(ctx, "console", false)
s := New(ctx, "console", "", false)
err = s.Start()
require.NoError(t, err)