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:
Jan Möller
2019-11-02 14:15:33 +09:00
committed by KUOKA Yusuke
parent 3f02b86640
commit 6955d07ea8
6 changed files with 10 additions and 19 deletions
+2 -6
View File
@@ -13,10 +13,6 @@ import (
"go.uber.org/zap/zapcore"
)
const (
command = "helm"
)
type decryptedSecret struct {
mutex sync.RWMutex
bytes []byte
@@ -50,9 +46,9 @@ func NewLogger(writer io.Writer, logLevel string) *zap.SugaredLogger {
}
// New for running helm commands
func New(logger *zap.SugaredLogger, kubeContext string, runner Runner) *execer {
func New(helmBinary string, logger *zap.SugaredLogger, kubeContext string, runner Runner) *execer {
return &execer{
helmBinary: command,
helmBinary: helmBinary,
logger: logger,
kubeContext: kubeContext,
runner: runner,