fix audit config docs

This commit is contained in:
Willy Kloucek
2022-03-14 14:21:37 +01:00
parent 6cd3827e2d
commit e5cae733b1
4 changed files with 55 additions and 31 deletions
+4 -11
View File
@@ -4,6 +4,7 @@ import (
"errors"
"github.com/owncloud/ocis/audit/pkg/config"
"github.com/owncloud/ocis/audit/pkg/config/defaults"
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/config/envdecode"
@@ -16,17 +17,7 @@ func ParseConfig(cfg *config.Config) error {
return err
}
// provide with defaults for shared logging, since we need a valid destination address for BindEnv.
if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil {
cfg.Log = &config.Log{
Level: cfg.Commons.Log.Level,
Pretty: cfg.Commons.Log.Pretty,
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil {
cfg.Log = &config.Log{}
}
defaults.EnsureDefaults(cfg)
// load all env variables relevant to the config in the current context.
if err := envdecode.Decode(cfg); err != nil {
@@ -36,5 +27,7 @@ func ParseConfig(cfg *config.Config) error {
}
}
defaults.Sanitize(cfg)
return nil
}