-
Notifications
You must be signed in to change notification settings - Fork 256
Change GitRepo deletion. #4361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change GitRepo deletion. #4361
Conversation
a24d029 to
fcc8657
Compare
This PR introduces changes to how GitRepos are deleted, as well as their dependent resources. Two main changes are introduced: * The function that deletes the GitRepo has been modified to check for any pending resources, especially *Bundles* and *ImageScans*, since previously the *GitRepo* was removed before these resources were fully deleted. * A new controller is introduced for *Content* resources to track the number of *BundleDeployments* that reference the same one. This controller aims to eliminate the conflicts that occurred when updating or deleting *BundleDeployments*, as they were being updated or removed concurrently while modifying a shared *Content* resource. With these changes, the goal is to eliminate both update conflicts (which triggered additional Reconcile calls in the controllers) and potential race conditions when deleting and recreating *GitRepos* that still had dependent resources pending deletion. Signed-off-by: Xavi Garcia <[email protected]>
fcc8657 to
f59b831
Compare
weyfonk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels cleaner than the previous approach, if slightly more "manual".
Finalizers were not the right tool for the job, it seems :)
| bd.Spec.ValuesHash = valuesHash | ||
|
|
||
| // When content resources are stored in etcd, we need to keep track of the content resource so they | ||
| // are properly gargabe collected by the content controller. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
| // are properly gargabe collected by the content controller. | |
| // are properly garbage-collected by the content controller. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can still see this typo ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've searched at the whole project and I can't find it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still says "gargabe" instead of "garbage".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will fix in a future PR, sorry for the confusion
64317ed to
d46f405
Compare
Signed-off-by: Xavi Garcia <[email protected]>
d46f405 to
d0d4dc6
Compare
Signed-off-by: Xavi Garcia <[email protected]>
* Change GitRepo deletion. This PR introduces changes to how GitRepos are deleted, as well as their dependent resources. Two main changes are introduced: * The function that deletes the GitRepo has been modified to check for any pending resources, especially *Bundles* and *ImageScans*, since previously the *GitRepo* was removed before these resources were fully deleted. * A new controller is introduced for *Content* resources to track the number of *BundleDeployments* that reference the same one. This controller aims to eliminate the conflicts that occurred when updating or deleting *BundleDeployments*, as they were being updated or removed concurrently while modifying a shared *Content* resource. With these changes, the goal is to eliminate both update conflicts (which triggered additional Reconcile calls in the controllers) and potential race conditions when deleting and recreating *GitRepos* that still had dependent resources pending deletion. --------- Signed-off-by: Xavi Garcia <[email protected]>
* Change GitRepo deletion. This PR introduces changes to how GitRepos are deleted, as well as their dependent resources. Two main changes are introduced: * The function that deletes the GitRepo has been modified to check for any pending resources, especially *Bundles* and *ImageScans*, since previously the *GitRepo* was removed before these resources were fully deleted. * A new controller is introduced for *Content* resources to track the number of *BundleDeployments* that reference the same one. This controller aims to eliminate the conflicts that occurred when updating or deleting *BundleDeployments*, as they were being updated or removed concurrently while modifying a shared *Content* resource. With these changes, the goal is to eliminate both update conflicts (which triggered additional Reconcile calls in the controllers) and potential race conditions when deleting and recreating *GitRepos* that still had dependent resources pending deletion. --------- Signed-off-by: Xavi Garcia <[email protected]>
This PR introduces changes to how GitRepos are deleted, as well as their dependent resources.
Two main changes are introduced:
The function that deletes the GitRepo has been modified to check for any pending resources, especially Bundles and ImageScans, since previously the GitRepo was removed before these resources were fully deleted.
A new controller is introduced for Content resources to track the number of BundleDeployments that reference the same one. This controller aims to eliminate the conflicts that occurred when updating or deleting BundleDeployments, as they were being updated or removed concurrently while modifying a shared Content resource.
With these changes, the goal is to eliminate both update conflicts (which triggered additional Reconcile calls in the controllers) and potential race conditions when deleting and recreating GitRepos that still had dependent resources pending deletion.
Refers to #4192
Refers to #4251
Additional Information
Checklist
- [ ] I have updated the documentation via a pull request in thefleet-docs repository.