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

[Regression] Chart 2.27.1 Deployment Label Selectors cause "field is immutable" error on deployment. #655

Open
hjannasch opened this issue Feb 24, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@hjannasch
Copy link

Describe the bug
Helm Upgrade command fails due to new deployment labels.

UPGRADE FAILED: cannot patch \"opensearch-dashboards\" with kind Deployment: Deployment.apps \"opensearch-dashboards\" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{\"app.kubernetes.io/instance\":\"opensearch-dashboards\", \"app.kubernetes.io/name\":\"opensearch-dashboards\"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable\n"

To Reproduce
Steps to reproduce the behavior:

  1. Install opensearch-dashboards-2.27.0 chart
  2. Run https://helm.sh/docs/helm/helm_upgrade/ with new chart version 2.27.1
  3. Watch errors from helm cli

Expected behavior
Helm Upgrade should work

Chart Name
opensearch-dashboards-2.27.1

@hjannasch hjannasch added bug Something isn't working untriaged Issues that have not yet been triaged labels Feb 24, 2025
@hm2thr33
Copy link

Same here

Error: UPGRADE FAILED: cannot patch "dashboard" with kind Deployment: Deployment.apps "dashboard" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/instance":"rs-opensearch-dashboard-dev-eu1", "app.kubernetes.io/name":"opensearch-dashboards"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable

@hm2thr33
Copy link

As a temporary solution, it helped me to completely remove the deployment dashboard and install it again
but I need to have it updated without deleting it on the prod

@DandyDeveloper
Copy link
Collaborator

@hjannasch This is due to #628 changing the selector labels.

The values are considered immutable and the upgrades are probably in need of a --force flag in order to forcibly replace the Deployment resource.

Frustratingly, this was fixing a "bug" but also introduced this regression.

https://github.com/opensearch-project/helm-charts/pull/629/files#diff-5b66dc142a0e1d9b77fbe8cb0007fdb222ae2e311fddd0f366422d05106a237fL16-L22

@DandyDeveloper DandyDeveloper removed the untriaged Issues that have not yet been triaged label Feb 25, 2025
@DandyDeveloper DandyDeveloper changed the title Bug - opensearch-dashboards-2.27.1 labels not compatible [Regression] Chart 2.27.1 Deployment Label Selectors cause "field is immutable" error on deployment. Feb 25, 2025
@DandyDeveloper
Copy link
Collaborator

I've updated the title for others coming into here. @peterzhuamazon

Do you have a suggestion here? Technically, reverting would "solve" the issue but the chart is technically bugged without these fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🆕 New
Development

No branches or pull requests

3 participants