Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove versions from volumeClaimTemplates labels #233

Closed
aschmalfeld opened this issue Feb 6, 2023 · 1 comment · Fixed by #524
Closed

Remove versions from volumeClaimTemplates labels #233

aschmalfeld opened this issue Feb 6, 2023 · 1 comment · Fixed by #524

Comments

@aschmalfeld
Copy link

I tried to install a new version of clamAv on our kubernetes cluster via the helm upgrade --install command while a previous version was already installed and got the following error :

Error: UPGRADE FAILED: release clamav failed, and has been rolled back due to atomic being set: cannot patch "clamav" with kind StatefulSet: StatefulSet.apps "clamav" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden helm.go:84: [debug] cannot patch "clamav" with kind StatefulSet: StatefulSet.apps "clamav" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden

I believe the reason is that the labels in the volumeClaimTemplates of the StatefulSet contain the appVersion and the version of the helm chart. Those versions obviously change when the app or the chart get updated but volumeClaimTemplates in a StatefulSet are not allowed to be updated.
I looked at other StatefulSets that we use and they don't have versions in the labels or no labels at all.
This can of course be worked around by deleting the helm release and installing again but it would still be nice if it got fixed.

@desaintmartin
Copy link
Member

Hello,
Indeed, this is a bad practice! I even reported it back myself a few years ago to the then-centralized charts repository: helm/charts#7803, but #46 broke it and I never realized it. We still could have matchLabels (example: https://github.com/bitnami/charts/blob/cfbfe86992eb83aa39118222bb9b13c14febced9/bitnami/redis/templates/master/application.yaml#L498) which are immutable, and do a breaking change.

PR accepted!

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

Successfully merging a pull request may close this issue.

2 participants