Repository navigation
Allow deleting paused PackageRepositories - #1878
Open
NopeCharon wants to merge 1 commit into
Open
NopeCharon wants to merge 1 commit into
NopeCharon wants to merge 1 commit into
Conversation
A PackageRepository with `spec.paused: true` could not be deleted: the reconciler checked for the paused state before checking for a deletion timestamp, so a paused repository being deleted only ever had its status refreshed and its finalizer was never removed. Clients such as kapp then blocked forever waiting for the resource to go away. Check for a deletion timestamp first so that deletion proceeds regardless of the paused state. This mirrors the ordering used by the App reconciler, which already allows paused Apps (and therefore paused PackageInstalls) to be deleted. Add a unit test that reconciles a paused PackageRepository marked for deletion and asserts that its finalizer is removed. Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
This branch has not been deployed
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.
What this PR does / why we need it:
A PackageRepository with
spec.paused: truecannot be deleted. The PackageRepository reconciler checksspec.pausedbefore it checks for a deletion timestamp. So when a paused repository is being deleted, the reconciler only refreshes its status and never removes the finalizer. Clients such as kapp then wait forever for the resource to go away.This PR checks for the deletion timestamp first, so deletion proceeds whether or not the repository is paused. The App reconciler already uses this order (#568), which is why paused Apps and PackageInstalls can be deleted.
Which issue(s) this PR fixes:
Fixes #898
Does this PR introduce a user-facing change?
Additional Notes for your reviewer:
Added
TestPausedPackageRepositoryIsDeleted. It reconciles a paused PackageRepository that is marked for deletion and checks that its finalizer is removed. The test fails without the fix (the finalizer remains) and passes with it.Review Checklist:
a link to that PR
change
Additional documentation e.g., Proposal, usage docs, etc.: