helmfile --helm-binary does not work with sync when updating repo

Created on 19 Sep 2018  ·  5Comments  ·  Source: roboll/helmfile

helmfile -b [path/to/helm] sync
is broken as it tries to update with $PATH found helm.
It does use the binary path specified with -b for helm upgrade though.
Tested on version 0.35.0 and 0.36.0

debug output:
helm repo update uses the binary found in $PATH
helm upgrade --install uses the binary from -b
`
[root@server ~]# /usr/local/bin/helmfile --log-level debug --helm-binary /usr/local/bin/helm --file /etc/kubernetes/helmfile/helmfile.yaml sync --args "--tls --tiller-namespace=$NS"
Processing /etc/kubernetes/helmfile/helmfile.yaml
second-pass rendering result of "/etc/kubernetes/helmfile/helmfile.yaml":
0: ---
1: repositories:
2: - name: internal
3: url: $REPO_URL
4:
5: releases:
6: - name: $CHART
7: namespace: $NS
8: chart: internal/$CHART
9: version: ~1.0.0

Adding repo internal $REPO_URL
exec: helm repo add internal $REPO_URL
"internal" has been added to your repositories

Updating repo
exec: helm repo update
Hang tight while we grab the latest from your chart repositories...
...Skip local chart repository
...Successfully got an update from the "internal" chart repository
...Unable to get an update from the "stable" chart repository (https://kubernetes-charts.storage.googleapis.com):
Get https://kubernetes-charts.storage.googleapis.com/index.yaml: dial tcp 172.217.9.144:443: i/o timeout
Update Complete. ⎈ Happy Helming!⎈

Upgrading internal/$CHART
exec: /usr/local/bin/helm upgrade --install --reset-values $CHART internal/$CHART --version ~1.0.0 --namespace $NS --tls --tiller-namespace=$NS
E0919 14:07:14.677804 78195 portforward.go:303] error copying from remote stream to local connection: readfrom tcp4 127.0.0.1:37225->127.0.0.1:44230: write tcp4 127.0.0.1:37225->127.0.0.1:44230: write: broken pipe
Release "$CHART" has been upgraded. Happy Helming!
LAST DEPLOYED: Wed Sep 19 14:07:14 2018
NAMESPACE: $NS
STATUS: DEPLOYED
`

Most helpful comment

Could we not run a check like
if c.GlobalString("helm-binary") != "" { helm.SetHelmBinary(c.GlobalString("helm-binary")) }
in the FindAndIterateOverDesiredStates function to avoid having that check for all helmfile subcommands?

All 5 comments

I'm guessing we need to evaluate the the helm binary path here before it attempts to update repos/depedencies?

Action: func(c *cli.Context) error { return findAndIterateOverDesiredStatesUsingFlags(c, func(state *state.HelmState, helm helmexec.Interface) []error { if errs := state.SyncRepos(helm); errs != nil && len(errs) > 0 { return errs } if errs := state.UpdateDeps(helm); errs != nil && len(errs) > 0 { return errs } return executeSyncCommand(c, state, helm) }) }

Could we not run a check like
if c.GlobalString("helm-binary") != "" { helm.SetHelmBinary(c.GlobalString("helm-binary")) }
in the FindAndIterateOverDesiredStates function to avoid having that check for all helmfile subcommands?

@georgejdli Thanks for the detailed report! #352 should fix this. Could you try again with v0.36.1 that is beging released shortly?

@mumoshu Thanks for the quick fix! Working as expected now.

@georgejdli Your investigation helped me a lot. Thanks for your cooperation ☺️

Was this page helpful?
0 / 5 - 0 ratings