aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/service.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/admin/service.go')
-rw-r--r--internal/admin/service.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/internal/admin/service.go b/internal/admin/service.go
index d60a072..f3d705c 100644
--- a/internal/admin/service.go
+++ b/internal/admin/service.go
@@ -27,11 +27,15 @@ func (s *Servicer) Reload() {
slog.Error("refusing to reload config")
return
}
- oldConfig := s.Conf
+ slog.Debug("config base after load", "path", tmpConfig.basePath)
+ // copy
+ oldConfig := *s.Conf
+ slog.Debug("config base before copy", "path", s.Conf.basePath)
s.Conf = tmpConfig
+ slog.Debug("config base after copy", "path", s.Conf.basePath)
if err := s.InitServer(); err != nil {
slog.Error("couldn't init server with new config, falling back", err)
- s.Conf = oldConfig
+ s.Conf = &oldConfig
if err := s.InitServer(); err != nil {
slog.Error("couldn't init server with old config, falling back", err)
panic("new and old config couldn't init server, no available config to run")
@@ -66,6 +70,7 @@ func (s *Servicer) InitServer() error {
}
slog.Info("policy loaded")
slog.Debug("init server", "repoDir", s.reposDir)
+ slog.Debug("init server", "repoDir", s.Conf.basePath)
if err := s.Conf.ConfigureRepos(); err != nil {
return fmt.Errorf("couldn't configure repos %w", err)
}
@@ -92,7 +97,6 @@ func NewService(modelPath, policyPath, serverConfigPath, reposDir string, mgmtRe
} else if err != nil {
return &Servicer{}, fmt.Errorf("Coudln't load server config. %w", err)
}
- conf.basePath = reposDir
svc := &Servicer{
enf,
conf,