Skip to content

Commit

Permalink
Removed the deprecated flag -config-yaml (grafana#3225)
Browse files Browse the repository at this point in the history
* Removed the deprecated flag -config-yaml

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Fixed doc

Signed-off-by: Marco Pracucci <marco@pracucci.com>
  • Loading branch information
pracucci authored Sep 23, 2020
1 parent 6f1287f commit 463ddb0
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions schema_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
yaml "gopkg.in/yaml.v2"

"github.com/cortexproject/cortex/pkg/util"
"github.com/cortexproject/cortex/pkg/util/flagext"
)

const (
Expand Down Expand Up @@ -76,28 +75,16 @@ func (d *DayTime) String() string {
type SchemaConfig struct {
Configs []PeriodConfig `yaml:"configs"`

fileName string
legacyFileName string
fileName string
}

// RegisterFlags adds the flags required to config this to the given FlagSet.
func (cfg *SchemaConfig) RegisterFlags(f *flag.FlagSet) {
f.StringVar(&cfg.fileName, "schema-config-file", "", "The path to the schema config file. The schema config is used only when running Cortex with the chunks storage.")
// TODO(gouthamve): Add a metric for this.
f.StringVar(&cfg.legacyFileName, "config-yaml", "", "DEPRECATED(use -schema-config-file) The path to the schema config file.")
}

// loadFromFile loads the schema config from a yaml file
func (cfg *SchemaConfig) loadFromFile() error {
if cfg.fileName == "" {
cfg.fileName = cfg.legacyFileName

if cfg.legacyFileName != "" {
flagext.DeprecatedFlagsUsed.Inc()
level.Warn(util.Logger).Log("msg", "running with DEPRECATED flag -config-yaml, use -schema-config-file instead")
}
}

if cfg.fileName == "" {
return errConfigFileNotSet
}
Expand Down

0 comments on commit 463ddb0

Please sign in to comment.