Skip to content

fix: allow chart to be upgradable#127

Open
lae wants to merge 1 commit intodgraph-io:mainfrom
amplify-security:fix/chart-upgrades
Open

fix: allow chart to be upgradable#127
lae wants to merge 1 commit intodgraph-io:mainfrom
amplify-security:fix/chart-upgrades

Conversation

@lae
Copy link
Copy Markdown

@lae lae commented Sep 19, 2025

Removes chart name/version from selector labels, which for StatefulSets are meant to be immutable. This seems to be what other chart maintainers have done, e.g. elastic/helm-charts#622

see helm/charts#7680

This fixes the following error when upgrading a helm release to a newer chart version:

- app_version: v25.0.0-preview6
  chart: dgraph-25.0.0-preview6
  description: 'Upgrade "dgraph" failed: cannot patch "dgraph-dgraph-ratel" with kind
    Deployment: Deployment.apps "dgraph-dgraph-ratel" is invalid: spec.selector: Invalid
    value: v1.LabelSelector{MatchLabels:map[string]string{"app":"dgraph", "chart":"dgraph-25.0.0-preview6",
    "component":"ratel", "release":"dgraph"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}:
    field is immutable && cannot patch "dgraph-dgraph-alpha" with kind StatefulSet:
    StatefulSet.apps "dgraph-dgraph-alpha" is invalid: spec: Forbidden: updates to
    statefulset spec for fields other than ''replicas'', ''ordinals'', ''template'',
    ''updateStrategy'', ''persistentVolumeClaimRetentionPolicy'' and ''minReadySeconds''
    are forbidden && cannot patch "dgraph-dgraph-zero" with kind StatefulSet: StatefulSet.apps
    "dgraph-dgraph-zero" is invalid: spec: Forbidden: updates to statefulset spec
    for fields other than ''replicas'', ''ordinals'', ''template'', ''updateStrategy'',
    ''persistentVolumeClaimRetentionPolicy'' and ''minReadySeconds'' are forbidden'
  revision: 6
  status: failed
  updated: "2025-09-18T22:17:57.424354119Z"

Still requires deleting StatefulSets (or running helm with --force?) for existing deployments though to remove the problematic label, I think.

removes chart name/version from selector labels,
which are meant to be immutable.
see helm/charts#7680
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants