Skip to content

Commit feb5809

Browse files
author
Thor
committed
validate configs
Signed-off-by: Thor <[email protected]>
1 parent c53be35 commit feb5809

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pkg/chunk/storage/factory.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
6161
}
6262

6363
// Validate config and returns error on failure
64-
// TODO need to rebase to call it, because Config validation has been added just recently
6564
func (cfg *Config) Validate() error {
6665
if cfg.Engine != StorageEngineChunks && cfg.Engine != StorageEngineTSDB {
6766
return errors.New("unsupported storage engine")

pkg/cortex/cortex.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ func (c *Config) Validate() error {
122122
if err := c.Encoding.Validate(); err != nil {
123123
return errors.Wrap(err, "invalid encoding config")
124124
}
125+
126+
if err := c.Storage.Validate(); err != nil {
127+
return errors.Wrap(err, "invalid storage config")
128+
}
129+
130+
if err := c.TSDB.Validate(); err != nil {
131+
return errors.Wrap(err, "invalid TSDB config")
132+
}
125133
return nil
126134
}
127135

0 commit comments

Comments
 (0)