From 365206507ae8ef2f4a70bf416487a22bb2b0803a Mon Sep 17 00:00:00 2001 From: Taylor Brennan Date: Fri, 8 Dec 2023 10:07:58 -0500 Subject: [PATCH] remove arg validation on optional parameter (#136) --- pkg/cmd/ctlstore/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/ctlstore/main.go b/pkg/cmd/ctlstore/main.go index 4fbe397..31bbb99 100644 --- a/pkg/cmd/ctlstore/main.go +++ b/pkg/cmd/ctlstore/main.go @@ -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 { @@ -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{}