mirror of
https://github.com/ko-build/ko.git
synced 2026-06-18 20:14:08 +02:00
Set AutomaticEnv for viper (#131)
This allows viper configuration to be set using environment variables instead of just with a config file.
This commit is contained in:
@@ -77,6 +77,8 @@ func init() {
|
||||
// If omitted, use this base image.
|
||||
viper.SetDefault("defaultBaseImage", "gcr.io/distroless/static:latest")
|
||||
viper.SetConfigName(".ko") // .yaml is implicit
|
||||
viper.SetEnvPrefix("KO")
|
||||
viper.AutomaticEnv()
|
||||
|
||||
if override := os.Getenv("KO_CONFIG_PATH"); override != "" {
|
||||
viper.AddConfigPath(override)
|
||||
|
||||
Reference in New Issue
Block a user