Repository navigation
Make takeOwnership a standing claim and detect ownership drift - #418
jonasz-lasut merged 1 commit into
Conversation
767ae33 to
7e720ff
Compare
|
Hi @stevendborrelli thank you for your contribution, I've added 3 comments. Also please sign the DCO |
takeOwnership adopts a pre-existing release once, but nothing afterwards guarded that adoption: when another actor re-stamped the ownership metadata on an already-adopted resource, nothing in the chart, values, or digest changed, Helm only validates ownership for resources it is about to create, and the release sat "up to date" while somebody else owned part of it. - Observe compares live ownership metadata (managed-by label, both meta.helm.sh annotations) on every rendered resource while takeOwnership is set, via the new OwnershipDrifted helper, and reports out of date where any differ so the triggered upgrade re-stamps them; status.synced and Available stay untouched. The check runs only when no deploy is owed from other causes, and fetches PartialObjectMetadata so per-reconcile lookups carry only metadata - adoption itself keeps its one-time gate on the deploy path: Helm force-stamps ownership metadata on every upgrade regardless of TakeOwnership, so the drift-triggered upgrade is the repair, while adopting on every deploy would silently take over pre-existing objects a chart bump starts rendering - the failure the one-time design exists to prevent - releases still on client-side apply are exempt from detection: their patches derive from the manifests alone, so ownership keys the chart renders unchanged never change and detection would retry on every poll forever until ssaForceConflicts migrates them to ssa - field docs and regenerated CRDs document the ssaForceConflicts conflict consequence and the behavior change for existing takeOwnership releases - unit tests for drift detection, Observe gating (including the CSA exemption), and the one-shot deploy gate; verified end to end on kind (adoption, control, steady state) and against the stock uptest suite Addresses PR review comments on adoption gating, the CSA retry loop, and the provider-upgrade behavior change (kept field-gated with docs warning per maintainer preference). Co-Authored-By: Claude Code <noreply@anthropic.com> Signed-off-by: Steven Borrelli <steve@borrelli.org>
7e720ff to
61e5b18
Compare
Release notes snippet so I don;t forget to mention behavioral changes introduced in this PRImportant
Highlights
New Features
|
jonasz-lasut
left a comment
There was a problem hiding this comment.
Thank you for the contribution @stevendborrelli LGTM!
Thank you for discussing the options and making sure that we have the same understanding on how this feature is supposed to work
Description of your changes
Previously the
takeOwnershipoption was designed to work once: after the first successful application of the labels status is updated and it would not detect or process any other changes in ownership.This change changes the behavior to observe the metadata of the rendered resources and take ownership in the case of drift.
Fixes #
I have:
make reviewableto ensure this PR is ready for review.How has this code been tested