normalize store

This commit is contained in:
A.Unger
2021-11-08 12:22:56 +01:00
parent db9dc74555
commit 23cfb909eb
4 changed files with 15 additions and 66 deletions

View File

@@ -73,11 +73,8 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error {
// load all env variables relevant to the config in the current context.
conf.LoadOSEnv(config.GetEnv(), false)
if err = cfg.UnmapEnv(conf); err != nil {
return err
}
return nil
bindings := config.StructMappings(cfg)
return ociscfg.BindEnv(conf, bindings)
}
// SutureService allows for the store command to be embedded and supervised by a suture supervisor tree.

View File

@@ -21,14 +21,7 @@ func Server(cfg *config.Config) *cli.Command {
Name: "server",
Usage: "Start integrated server",
Before: func(ctx *cli.Context) error {
if err := ParseConfig(ctx, cfg); err != nil {
return err
}
logger := NewLogger(cfg)
logger.Debug().Str("service", "store").Msg("ignoring config file parsing when running supervised")
return nil
return ParseConfig(ctx, cfg)
},
Action: func(c *cli.Context) error {
logger := NewLogger(cfg)