config: add namespace support (#1780)

* config/cmd: use service namespace for config

* config/service: add namespace option to list
This commit is contained in:
ben-toogood
2020-07-02 14:07:58 +01:00
committed by GitHub
parent 3c633e3577
commit d577dd6abe
3 changed files with 45 additions and 31 deletions

View File

@@ -831,7 +831,11 @@ func (c *cmd) Before(ctx *cli.Context) error {
// Setup config sources
if ctx.String("config") == "service" {
opt := config.WithSource(configSrv.NewSource(configSrc.WithClient(microClient)))
opt := config.WithSource(configSrv.NewSource(
configSrc.WithClient(microClient),
configSrv.Namespace(ctx.String("service_namespace")),
))
if err := (*c.opts.Config).Init(opt); err != nil {
logger.Fatalf("Error configuring config: %v", err)
}