Remove CONFIG env var

This commit is contained in:
Thomas Miceli 2023-07-26 10:54:16 +02:00
parent 319a89387a
commit 89685bfac6
No known key found for this signature in database
GPG key ID: D86C6F6390AF050F

View file

@ -15,7 +15,7 @@ import (
"gopkg.in/yaml.v3" "gopkg.in/yaml.v3"
) )
var OpengistVersion = "1.4.2" var OpengistVersion = "1.5-dev"
var C *config var C *config
@ -175,17 +175,6 @@ func loadConfigFromYaml(c *config, configPath string) error {
fmt.Println("No YAML config file specified.") fmt.Println("No YAML config file specified.")
} }
// Override default values with environment variables (as yaml)
configEnv := os.Getenv("CONFIG")
if configEnv != "" {
fmt.Println("Using config from environment variable: CONFIG")
fmt.Println("!! This method of setting the config is deprecated and will be removed in a future version of Opengist")
d := yaml.NewDecoder(strings.NewReader(configEnv))
if err := d.Decode(&c); err != nil {
return err
}
}
return nil return nil
} }