Skip to content

fix: remove unstable selector labels in mssql and octopus statefulsets#540

Merged
oleksandr-codefresh merged 6 commits intomainfrom
lm/fix-sts-dynamic-selectors
May 7, 2026
Merged

fix: remove unstable selector labels in mssql and octopus statefulsets#540
oleksandr-codefresh merged 6 commits intomainfrom
lm/fix-sts-dynamic-selectors

Conversation

@liam-mackie
Copy link
Copy Markdown
Contributor

@liam-mackie liam-mackie commented Apr 16, 2026

Fixed issue

matchLabels (which is immutable) included label helm.sh/chart had dynamic value. That was preventing chart from upgrading

kind: StatefulSet
metadata:
  name: octopus-deploy
spec:
  selector:
    matchLabels:
      app.kubernetes.io/component: octopus-server
      app.kubernetes.io/instance: octopus-deploy
      app.kubernetes.io/managed-by: Helm
      app.kubernetes.io/name: octopus-deploy
      helm.sh/chart: octopusdeploy-helm-1.12.0 # this is dynamic value that causing issues during helm upgrade command

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 16, 2026

🦋 Changeset detected

Latest commit: 853e3d1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
octopus-deploy Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment thread charts/octopus-deploy/templates/pre-upgrade-hook.yaml
"helm.sh/hook": pre-upgrade
"helm.sh/hook-weight": "-5"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
rules:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a way to disable this hook (and the extra role/rolebinding/service account) since once the user upgrades and all the stateful sets are recreated with the correct labels, there is no longer need to run the hook.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what default behaviour u suggest?

  • enabled: false - that makes things inconvenient, as requires user to read docs once meet issue and we don't know from which version to which they gonna update.

  • enabled: true - I guess in most cases users also won't bother about having this extra value

Copy link
Copy Markdown
Contributor

@oleksandr-codefresh oleksandr-codefresh May 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

hooks:
  enableSelectorLabelsFix: true

@liam-mackie liam-mackie marked this pull request as ready for review May 6, 2026 08:31
@liam-mackie liam-mackie requested review from a team as code owners May 6, 2026 08:31
@oleksandr-codefresh oleksandr-codefresh force-pushed the lm/fix-sts-dynamic-selectors branch from d9cadf9 to f950d18 Compare May 7, 2026 04:03
@oleksandr-codefresh oleksandr-codefresh force-pushed the lm/fix-sts-dynamic-selectors branch from f950d18 to 853e3d1 Compare May 7, 2026 04:29
@oleksandr-codefresh oleksandr-codefresh merged commit 0a15041 into main May 7, 2026
9 checks passed
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 this pull request may close these issues.

3 participants