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.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/admin/service.go b/internal/admin/service.go
index 498215b..267a243 100644
--- a/internal/admin/service.go
+++ b/internal/admin/service.go
@@ -1,6 +1,7 @@
package admin
import (
+ "errors"
"log"
casbin "github.com/casbin/casbin/v2"
@@ -63,9 +64,12 @@ func NewService(modelPath, policyPath, serverConfigPath, reposDir string, mgmtRe
if err != nil {
log.Fatalf("Couldn't load the enforcer encountered the following error: %s", err)
}
-
conf, err := loadServerConfig(mgmtRepo, reposDir, serverConfigPath)
- if err != nil {
+ if errors.Is(err, ErrMgmtRepoNotFound) {
+ log.Print("no server config found, using default")
+ conf = defaultServerConfig
+
+ } else if err != nil {
// log.error
log.Fatalf("Coudln't load server config %s", err)
}