Skip to content

Commit

Permalink
remove arg validation on optional parameter (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
wavetylor authored Dec 8, 2023
1 parent f6fdf2c commit 3652065
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/cmd/ctlstore/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type reflectorCliConfig struct {
}

type multiReflectorConfig struct {
LDBPaths []string `conf:"ldb-paths" help:"list of ldbs, each ldb is managed by a unique reflector" validate:"nonzero"`
LDBPaths []string `conf:"ldb-paths" help:"list of ldbs, each ldb is managed by a unique reflector"`
}

type executiveCliConfig struct {
Expand Down Expand Up @@ -495,6 +495,10 @@ func multiReflector(ctx context.Context, args []string) {
enableDebug()
}

if len(cliCfg.MultiReflector.LDBPaths) <= 1 {
panic("multi-reflector mode requires at least 2 ldb paths")
}

var promHandler *prometheus.Handler
if len(cliCfg.MetricsBind) > 0 {
promHandler = &prometheus.Handler{}
Expand Down

0 comments on commit 3652065

Please sign in to comment.