mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-02 15:45:17 +02:00
HELMFILE_ENVIRONMENT variable (#1425)
Co-authored-by: Pawel Przeszlo <pawel.przeszlo@comarch.pl>
This commit is contained in:
co-authored by
Pawel Przeszlo
parent
7b11ce851a
commit
6b4b76e2bc
@@ -420,6 +420,9 @@ GLOBAL OPTIONS:
|
||||
--interactive, -i Request confirmation before attempting to modify clusters
|
||||
--help, -h show help
|
||||
--version, -v print the version
|
||||
|
||||
Environment variables:
|
||||
HELMFILE_ENVIRONMENT specify the environment name, the command line option '-e' have precedence
|
||||
```
|
||||
|
||||
### sync
|
||||
|
||||
@@ -681,7 +681,10 @@ func (c configImpl) Logger() *zap.SugaredLogger {
|
||||
func (c configImpl) Env() string {
|
||||
env := c.c.GlobalString("environment")
|
||||
if env == "" {
|
||||
env = state.DefaultEnv
|
||||
env = os.Getenv("HELMFILE_ENVIRONMENT")
|
||||
if env == "" {
|
||||
env = state.DefaultEnv
|
||||
}
|
||||
}
|
||||
return env
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user