You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the install of the chart fails for whatever reason, a secret with the name sh.helm.release.v1.chart.v1 is created with labels.status: uninstalled.
When an event causes the HelmRelease to be reconciled again (new chart version, new images via ImageUpdateAutomation) the helm-controller will try to install the chart again.
It'll keep doing this on events until the chart is succesfully installed, after which it will upgrade instead.
Actual behavior
When the install of the chart fails for whatever reason, a secret with the name sh.helm.release.v1.chart.v1 is created with labels.status: uninstalled.
When the HelmRelease is reconciled again, the helm-controller will run upgrade causing the Helm error Upgrade Failed: chart has no deployed releases.
This means the HelmRelease is now stuck and can only be fixed by manually deleting the secret sh.helm.release.v1.chart.v1.
Possible solution
I think the issue comes from the following code;
First, the last observed release is retrieved using helm history. In the above example, this will be the v1 with labels.status: uninstalled.
To decide on an install of upgrade, we only check if an last observed release exists. It's not checked if the last release is uninstalled for instance. Since, in the case above, the HelmRelease has a release, the helm-controller decides to run upgrade.
I think this can either be solved by adding the --install flag by default to the upgrade command or checking if the latest observed released has the uninstalled status.
The text was updated successfully, but these errors were encountered:
Hi all,
Given a
HelmRelease
with the followinginstall
,uninstall
,upgrade
behavior:Expected behavior
When the install of the chart fails for whatever reason, a secret with the name
sh.helm.release.v1.chart.v1
is created withlabels.status: uninstalled
.When an event causes the
HelmRelease
to be reconciled again (new chart version, new images viaImageUpdateAutomation
) the helm-controller will try toinstall
the chart again.It'll keep doing this on events until the chart is succesfully installed, after which it will
upgrade
instead.Actual behavior
When the install of the chart fails for whatever reason, a secret with the name
sh.helm.release.v1.chart.v1
is created withlabels.status: uninstalled
.When the
HelmRelease
is reconciled again, the helm-controller will runupgrade
causing the Helm errorUpgrade Failed: chart has no deployed releases
.This means the
HelmRelease
is now stuck and can only be fixed by manually deleting the secretsh.helm.release.v1.chart.v1
.Possible solution
I think the issue comes from the following code;
First, the last observed release is retrieved using
helm history
. In the above example, this will be thev1
withlabels.status: uninstalled
.helm-controller/internal/controller/helmrelease_controller.go
Line 303 in 472244b
To decide on an install of upgrade, we only check if an
last observed release
exists. It's not checked if the last release isuninstalled
for instance. Since, in the case above, theHelmRelease
has a release, thehelm-controller
decides to runupgrade
.helm-controller/internal/controller/helmrelease_controller.go
Lines 396 to 408 in 472244b
I think this can either be solved by adding the
--install
flag by default to theupgrade
command or checking if the latest observed released has theuninstalled
status.The text was updated successfully, but these errors were encountered: