Repository navigation
Fix deletion of in-use artifacts and namespaces - #429
Merged
Merged
Conversation
The garbage collector was given a wildcard filename, which it compares literally, so the current artifact was never excluded. When a reconciliation took longer than the retention TTL, the artifacts it had just built were deleted while the ExternalArtifacts were Ready. Pass the filename of the current artifact instead. Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Dropping an output, or deleting the generator, removed the ExternalArtifact and its storage even when another ArtifactGenerator had taken it over. The storage was also removed when the API server rejected the deletion of the object, leaving it without its artifact. Verify the owner before pruning and delete the object before its storage, guarding the deletion against a concurrent takeover. The owner is matched by source reference too, so that recreated generators can still prune. Reading the owner requires the get verb, while the delete verb is no longer required for taken over objects. Document how to move an ExternalArtifact between generators. Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
When two ArtifactGenerators published the same ExternalArtifact, the garbage collection or pruning of one could remove the artifact that the other had just built or published. Hold a lock per ExternalArtifact until the end of the reconciliation. When an ExternalArtifact is locked by another generator, mark the object as not ready and requeue it, instead of blocking the worker. Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Dropping a managed namespace, or deleting the generator, with pruning enabled deleted the namespace and everything in it, even when another ArtifactGenerator had taken it over. Verify the owner label before deleting. Replace the deletion made with the SSA manager with a direct call that has the same exclusions and propagation policy, guarded by preconditions, so that a change made after the verification results in a conflict that is retried. Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Member
Author
|
I'll backport this by hand to v2.3.x due to conflicts. |
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.
Fixes: #427
DependencyNotReadyand requeuedBehavior changes:
getverb on the ServiceAccount, in addition todeleteCloses: #428