From 467ae0770a550603591030461dc98623c93d69be Mon Sep 17 00:00:00 2001 From: Cyril Tovena Date: Mon, 10 Jan 2022 15:52:46 +0100 Subject: [PATCH] Removes split-by upstream validation Signed-off-by: Cyril Tovena --- pkg/querier/queryrange/roundtrip.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/querier/queryrange/roundtrip.go b/pkg/querier/queryrange/roundtrip.go index 9cab48feff534..8aadcaf4559d5 100644 --- a/pkg/querier/queryrange/roundtrip.go +++ b/pkg/querier/queryrange/roundtrip.go @@ -8,6 +8,7 @@ import ( "github.com/cortexproject/cortex/pkg/querier/queryrange" "github.com/go-kit/log" + "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/prometheus/model/labels" "github.com/weaveworks/common/httpgrpc" @@ -30,6 +31,16 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) { cfg.Config.RegisterFlags(f) } +// Validate validates the config. +func (cfg *Config) Validate() error { + if cfg.CacheResults { + if err := cfg.ResultsCacheConfig.Validate(); err != nil { + return errors.Wrap(err, "invalid ResultsCache config") + } + } + return nil +} + // Stopper gracefully shutdown resources created type Stopper interface { Stop()