Skip to content

[Backport release-1.6] fix(platform): keep the legacy etcd-operator stopped after etcd adoption - #4739

Open
europrinter (yankawai) wants to merge 1 commit into
cozystack:release-1.6from
yankawai:backport/etcd-adoption-keep-legacy-operator-down-1.6
Open

europrinter (yankawai) wants to merge 1 commit into
cozystack:release-1.6from
yankawai:backport/etcd-adoption-keep-legacy-operator-down-1.6

Conversation

@yankawai

@yankawai europrinter (yankawai) commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

Backport of #4738 to release-1.6, cherry-picked without changes from 6248d458ad57c5991700dc26c5abc1340b1a05f4.

Migration 50 scaled the legacy etcd-operator back to 1 after adopting the legacy etcd clusters. Until a tenant's etcd HelmRelease reconciled the new chart, Flux re-created the legacy EtcdCluster from the old one, and the running legacy operator re-created the legacy StatefulSet and took the legacy etcd-headless Service away from the adopted EtcdMembers. The garbage collector deleted the Service when the new chart pruned that EtcdCluster, and the adopted members' etcd-<i>.etcd-headless names stopped resolving. This hit every tenant etcd on a cluster upgraded from 1.4.3 to 1.6.4, and upgrades from 1.4 and 1.5 to 1.6 go through this branch. The operator now stays at 0 after a successful adoption until the etcd-operator HelmRelease replaces it, and a failed adoption still restores it through the EXIT trap. The full timeline from the audit log and the repair for already upgraded clusters are in #4738.

Validation

  • The commit applies cleanly to release-1.6 at da98ddc08.
  • hack/cozytest.sh hack/migration-50-etcd-adopt.bats passes all 29 tests on this branch. The new test fails against the release-1.6 script with FAIL: the legacy operator was scaled back up after a successful adoption.

Screenshots

Not a UI change.

Downstream repositories

Same diff as #4738, where the trigger map was walked file by file. No entry matches.

Release note

fix(platform): backport to 1.6 the fix that keeps the legacy etcd-operator stopped after migration 50 adopts the legacy etcd clusters, so the adopted members keep their etcd-headless DNS names through the upgrade.

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: cozystack/cozystack/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ab9c74e2-97f2-4908-8206-b781ddb8fe17

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added area/platform Issues or PRs related to platform infrastructure (bundle, flux, talos, installer) area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) kind/bug Categorizes issue or PR as related to a bug labels Oct 3, 2026
Migration 50 scales the legacy etcd-operator to 0, adopts every legacy
etcd.aenix.io cluster with etcd-migrate and then scales the operator
back to 1. At that point it is still the legacy operator, and it has
nothing left to manage. Until a tenant's etcd HelmRelease reconciles the
new chart, Flux can upgrade it with the old one, which re-creates the
legacy EtcdCluster that etcd-migrate just orphan-deleted. The legacy
operator then reconciles it, re-creates the legacy StatefulSet and
rewrites the legacy etcd-headless Service, dropping the owner references
etcd-migrate pointed at the adopted EtcdMembers. When the new chart
prunes the legacy EtcdCluster, the garbage collector deletes the Service
with it, and the adopted members' etcd-<i>.etcd-headless names stop
resolving.

After a successful adoption the operator now stays at 0 until the
etcd-operator HelmRelease replaces the Deployment with the v1alpha2
operator later in the same upgrade. A failed or interrupted adoption
still restores it through the EXIT trap.

Assisted-by: LLM
Signed-off-by: Yan Bondarenko <[email protected]>
(cherry picked from commit 6248d45)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/platform Issues or PRs related to platform infrastructure (bundle, flux, talos, installer) area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) kind/bug Categorizes issue or PR as related to a bug size/M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant