add support for HELMFILE_FILE_PATH envvar to set -f (#1255)

* fix imports

Signed-off-by: Shane Starcher <shanestarcher@gmail.com>

* unset env var

Signed-off-by: Shane Starcher <shanestarcher@gmail.com>

---------

Signed-off-by: Shane Starcher <shanestarcher@gmail.com>
This commit is contained in:
Shane Starcher
2024-01-03 21:37:49 +08:00
committed by GitHub
parent 4871a92b8c
commit d681c62ff8
4 changed files with 57 additions and 2 deletions
+2 -1
View File
@@ -15,6 +15,7 @@ import (
"go.uber.org/zap"
"github.com/helmfile/helmfile/pkg/argparser"
"github.com/helmfile/helmfile/pkg/envvar"
"github.com/helmfile/helmfile/pkg/filesystem"
"github.com/helmfile/helmfile/pkg/helmexec"
"github.com/helmfile/helmfile/pkg/plugins"
@@ -1216,7 +1217,7 @@ func (a *App) findDesiredStateFiles(specifiedPath string, opts LoadOpts) ([]stri
case defaultFile != "":
return []string{defaultFile}, nil
default:
return []string{}, fmt.Errorf("no state file found. It must be named %s/*.{yaml,yml,yaml.gotmpl,yml.gotmpl}, %s, or %s, otherwise specified with the --file flag", DefaultHelmfileDirectory, DefaultHelmfile, DefaultGotmplHelmfile)
return []string{}, fmt.Errorf("no state file found. It must be named %s/*.{yaml,yml,yaml.gotmpl,yml.gotmpl}, %s, or %s, otherwise specified with the --file flag or %s environment variable", DefaultHelmfileDirectory, DefaultHelmfile, DefaultGotmplHelmfile, envvar.FilePath)
}
}