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

Helm Chart Upgrades Fail due to immutable selector fields in deployment. #140

Closed
logand22 opened this issue Dec 4, 2023 · 0 comments · Fixed by #141
Closed

Helm Chart Upgrades Fail due to immutable selector fields in deployment. #140

logand22 opened this issue Dec 4, 2023 · 0 comments · Fixed by #141

Comments

@logand22
Copy link
Contributor

logand22 commented Dec 4, 2023

I believe a bug was introduced in #115 when the selector fields were upgraded to use {{- include "version-checker.labels" . | nindent 6 }}. This is because version-checker.labels includes things like app.kubernetes.io/version which changes on newer versions. The selector field is immutable in Deployments and shouldn't change between the same release.

To replicate:

$ helm upgrade -i version-checker jetstack/version-checker --version v0.3.1
Release "version-checker" does not exist. Installing it now.
NAME: version-checker
LAST DEPLOYED: Mon Dec  4 15:49:49 2023
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None

$ helm upgrade -i version-checker jetstack/version-checker --version v0.3.2
Error: UPGRADE FAILED: cannot patch "version-checker" with kind Deployment: Deployment.apps "version-checker" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/instance":"version-checker", "app.kubernetes.io/managed-by":"Helm", "app.kubernetes.io/name":"version-checker", "app.kubernetes.io/version":"v0.3.2", "helm.sh/chart":"version-checker-v0.3.2"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
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.

1 participant