Repository navigation
fix: preserve rollback resources for remigration - #99
Merged
Merged
Conversation
Record verified resource identities on the restored Subscription before removing the ClusterExtension backup. Retry conflicting updates and refuse to overwrite a changed Subscription. During remigration, include retained unowned resources missing from the OLMv0 inventory, skipping missing and duplicate objects while rejecting replacements and newly controlled objects. Add regression tests and update the migration specifications. Validation: make migration/test-unit; make lint; go test -tags=e2e ./test/e2e/migration -run ^$. Signed-off-by: Todd Short <tshort@redhat.com>
Member
Author
|
/approve |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: perdasilva, tmshort The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A rollback can leave catalog-generated resources, such as RBAC, in place after OLMv1 releases them. These resources may not appear in the restored OLMv0 InstallPlan. A subsequent migration can therefore omit them from the initial revision, causing an ownership collision when the catalog revision tries to create them.
Persist the verified resource identities and UIDs on the restored Subscription before removing the ClusterExtension recovery backup. During remigration, include retained resources that are still unowned and match their recorded UIDs, alongside the normal inventory. Missing resources are skipped; replaced or newly controlled resources are rejected. Normal collection remains deduplicated.
Saving the inventory retries resource-version conflicts, revalidates the Subscription spec on each attempt, and avoids rewriting an unchanged annotation. If the Subscription changes or persistence fails, rollback retains the ClusterExtension recovery backup.
This extracts behavior common to #95 and #97 and does not choose a handoff approach. Those PRs will need rebasing after this merges.
Validation
make migration/test-unitmake lintgo test -tags=e2e ./test/e2e/migration -run '^$'Unit tests cover retained, missing, replaced, claimed, duplicate, and malformed inventory entries, plus retry of a Subscription status conflict and refusal when its spec changes. E2E tests were compiled; they were not run for this PR.
Summary by CodeRabbit