Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

helm-op: Purge release if install fails #1344

Merged
merged 1 commit into from
Sep 6, 2018
Merged

helm-op: Purge release if install fails #1344

merged 1 commit into from
Sep 6, 2018

Conversation

stefanprodan
Copy link
Member

If a chart is broken, Tiller will reserve the name and mark the release as failed. If at a later time the chart is fixed, helm-op can't install it anymore because the release name is in use. Purging the release after each failed install allows helm-op to keep retrying the installation.

Fix #1343

If a chart is broken, Tiller will reserve the name and mark the release as failed. If at a later time the chart is fixed, helm-op can't install it anymore because the release name is in use. Purging the release after each failed install allows helm-op to keep retrying the installation.
@geoah
Copy link

geoah commented Sep 6, 2018

1. pushing broken chart for the first time

ts=2018-09-06T09:18:30.370705709Z caller=release.go:175 component=release error="Chart release failed: vault-controller: &status.statusError{Code:2, Message:\"release vault-controller failed: ClusterRole.rbac.authorization.k8s.io \\\"vault-controller\\\" is invalid: rules[0].apiGroups: Required value: resource rules must supply at least one api group\", Details:[]*any.Any(nil)}"
...
ts=2018-09-06T09:18:30.371122924Z caller=release.go:176 component=release info="Deleting failed release: [vault-controller]"
helm list
-- shows nothing

2. pushing working chart

ts=2018-09-06T09:26:33.550388616Z caller=release.go:135 component=release info="releaseName= vault-controller, action=CREATE, install options: {DryRun:false ReuseName:false}"
helm list
NAME                REVISION    UPDATED                     STATUS      CHART                     APP VERSION    NAMESPACE
vault-controller    1           Thu Sep  6 10:26:33 2018    DEPLOYED    vault-controller-0.1.1                   default

3. pushing broken chart

s=2018-09-06T09:30:12.575997977Z caller=release.go:135 component=release info="releaseName= vault-controller-temp, action=CREATE, install options: {DryRun:true ReuseName:false}"
ts=2018-09-06T09:30:12.580566756Z caller=release.go:135 component=release info="releaseName= datadog-agent-temp, action=CREATE, install options: {DryRun:true ReuseName:false}"
ts=2018-09-06T09:30:12.664316665Z caller=chartsync.go:415 component=chartsync error="Release vault-controller: Chart has diverged due to manual Chart release"
ts=2018-09-06T09:30:12.664440373Z caller=release.go:135 component=release info="releaseName= vault-controller, action=UPDATE, install options: {DryRun:false ReuseName:false}"
...
ts=2018-09-06T09:30:12.836069908Z caller=release.go:206 component=release error="Chart upgrade release failed: vault-controller: &status.statusError{Code:2, Message:\"ClusterRole.rbac.authorization.k8s.io \\\"vault-controller\\\" is invalid: rules[0].apiGroups: Required value: resource rules must supply at least one api group\", Details:[]*any.Any(nil)}"
ts=2018-09-06T09:30:12.836183597Z caller=chartsync.go:268 component=chartsync warning="Failed to upgrade chart" namespace=default name=vault-controller error="rpc error: code = Unknown desc = ClusterRole.rbac.authorization.k8s.io \"vault-controller\" is invalid: rules[0].apiGroups: Required value: resource rules must supply at least one api group"
ts=2018-09-06T09:30:12.836242905Z caller=operator.go:218 component=operator info="Successfully synced 'default/vault-controller'"
ts=2018-09-06T09:30:12.83627529Z caller=operator.go:173 component=operator debug="Processing next work queue job ..."
I0906 09:30:12.837467       5 event.go:221] Event(v1.ObjectReference{Kind:"FluxHelmRelease", Namespace:"default", Name:"vault-controller", UID:"3738d1ce-b1ad-11e8-9bc8-02b1ab54db8a", APIVersion:"helm.integrations.flux.weave.works/v1alpha2", ResourceVersion:"2023509", FieldPath:""}): type: 'Normal' reason: 'ChartSynced' Chart managed by FluxHelmRelease processed successfully
helm list
NAME                REVISION    UPDATED                     STATUS      CHART                     APP VERSION    NAMESPACE
vault-controller    2           Thu Sep  6 10:30:12 2018    FAILED      vault-controller-0.1.1                   default

4. pushing working chart

ts=2018-09-06T09:33:18.485710475Z caller=operator.go:218 component=operator info="Successfully synced 'default/vault-controller'"
ts=2018-09-06T09:33:18.485833611Z caller=operator.go:173 component=operator debug="Processing next work queue job ..."
I0906 09:33:18.486578       5 event.go:221] Event(v1.ObjectReference{Kind:"FluxHelmRelease", Namespace:"default", Name:"vault-controller", UID:"3738d1ce-b1ad-11e8-9bc8-02b1ab54db8a", APIVersion:"helm.integrations.flux.weave.works/v1alpha2", ResourceVersion:"2025102", FieldPath:""}): type: 'Normal' reason: 'ChartSynced' Chart managed by FluxHelmRelease processed successfully
helm list
NAME                REVISION    UPDATED                     STATUS      CHART                     APP VERSION    NAMESPACE
vault-controller    1           Thu Sep  6 10:33:17 2018    DEPLOYED    vault-controller-0.1.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helm operator failing to install if helm release is in a bad state
3 participants