-
Notifications
You must be signed in to change notification settings - Fork 297
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
Fixes #29122 - Correct CV deletion behavior for pulp3 #8594
Conversation
Issues: #29122 |
TODO:
Testing scenarios: I'd recommend running this query to get a good idea of what is in pulp3 and what gets deleted:
|
This fixes three situations: * Deleting a CVV would delete the pulp3 repository, deleting repo versions across all CVVs in that content view * Deleting a CV would NOT delete the pulp3 repository, when it should * Removing a CVV from a Lifecycle Env would not properly delete the distribution * If you deleted a CVV, that had re-used the version_href and publication_href from a Library repo, it would delete the library repo's pulp3 repo version (and thus its publication too).
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.
Worked as described, but I did have a question re the force_pulp3 parameter...
@@ -172,8 +172,8 @@ def self.with_type(content_type) | |||
joins(:root).where("#{RootRepository.table_name}.content_type" => content_type) | |||
end | |||
|
|||
def backend_service(smart_proxy) | |||
if smart_proxy.pulp3_support?(self) | |||
def backend_service(smart_proxy, force_pulp3 = false) |
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.
When would we use the force_pulp3
parameter?
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.
Its used in one place at the moment. When we delete a content view: https://github.com/Katello/katello/pull/8594/files#diff-d4b12ef3369bd829bf21911a41392ee5R17
If at this point we aren't using pulp3 for that type of content, but for some reason a Pulp3::RepositoryReference exists, it means we have to have run the content migration already, but are deleting stuff before actually switching over to pulp3. So it makes sense to force it in order to get the backend service object to delete the pulp3 repository.
This fixes four situations:
versions across all CVVs in that content view
distribution
publication_href from a Library repo, it would delete the library
repo's pulp3 repo version (and thus its publication too).