From 8a2c0ec574e2872af2646ef44b1e8d219a724dd0 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Wed, 19 Oct 2022 17:22:11 -0700 Subject: [PATCH] Flag to bypass strict config enforcement (#1105) Useful with the Helm charts, where other keys can be declared together. --- cmd/server/main.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd/server/main.go b/cmd/server/main.go index 45dbb9bd2..81036dab1 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -99,6 +99,11 @@ func main() { Name: "dev", Usage: "sets log-level to debug, console formatter, and /debug/pprof. insecure for production", }, + &cli.BoolFlag{ + Name: "disable-strict-config", + Usage: "disables strict config parsing", + Hidden: true, + }, }, Action: startServer, Commands: []*cli.Command{ @@ -156,7 +161,11 @@ func getConfig(c *cli.Context) (*config.Config, error) { return nil, err } - conf, err := config.NewConfig(confString, true, c) + strictMode := true + if c.Bool("disable-strict-config") { + strictMode = false + } + conf, err := config.NewConfig(confString, strictMode, c) if err != nil { return nil, err }