mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-18 19:38:37 +02:00
fix: Set HelmBinary in execer constructor (#928)
This overrides the default helm command, if provided, as soon as possible. This way it is already used in `visitStates`. I ran into an issue using `HELM3` and `--helm-binary` together with helm-secrets. I previously used tillerless, which i could now remove. This however caused `DecryptSecret` to fail, as it would still use the helm2 binary; because it runs before the first `helm.SetHelmBinary` call. While helm-secrets is not fully helm3 compatible yet, its uses within helmfile are, and i was able to just install it as a helm3 plugin.
This commit is contained in:
+1
-7
@@ -36,7 +36,6 @@ type App struct {
|
||||
Env string
|
||||
Namespace string
|
||||
Selectors []string
|
||||
HelmBinary string
|
||||
Args string
|
||||
ValuesFiles []string
|
||||
Set map[string]interface{}
|
||||
@@ -69,12 +68,11 @@ func New(conf ConfigProvider) *App {
|
||||
Env: conf.Env(),
|
||||
Namespace: conf.Namespace(),
|
||||
Selectors: conf.Selectors(),
|
||||
HelmBinary: conf.HelmBinary(),
|
||||
Args: conf.Args(),
|
||||
FileOrDir: conf.FileOrDir(),
|
||||
ValuesFiles: conf.StateValuesFiles(),
|
||||
Set: conf.StateValuesSet(),
|
||||
helmExecer: helmexec.New(conf.Logger(), conf.KubeContext(), &helmexec.ShellRunner{
|
||||
helmExecer: helmexec.New(conf.HelmBinary(), conf.Logger(), conf.KubeContext(), &helmexec.ShellRunner{
|
||||
Logger: conf.Logger(),
|
||||
}),
|
||||
})
|
||||
@@ -534,10 +532,6 @@ func (a *App) Wrap(converge func(*state.HelmState, helmexec.Interface) []error)
|
||||
}
|
||||
}
|
||||
|
||||
if a.HelmBinary != "" {
|
||||
helm.SetHelmBinary(a.HelmBinary)
|
||||
}
|
||||
|
||||
type Key struct {
|
||||
TillerNamespace, Name string
|
||||
}
|
||||
|
||||
+1
-1
@@ -1918,7 +1918,7 @@ func (mock *mockRunner) Execute(cmd string, args []string, env map[string]string
|
||||
}
|
||||
|
||||
func MockExecer(logger *zap.SugaredLogger, kubeContext string) helmexec.Interface {
|
||||
execer := helmexec.New(logger, kubeContext, &mockRunner{})
|
||||
execer := helmexec.New("helm", logger, kubeContext, &mockRunner{})
|
||||
return execer
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user