-
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 #37552 - container push repo content view support #11028
Conversation
a57bdee
to
7c461b6
Compare
I realize I need to add some tests. |
aba03a1
to
c301503
Compare
app/lib/actions/katello/environment/publish_container_repositories.rb
Outdated
Show resolved
Hide resolved
2cd4d6d
to
d49002b
Compare
One test should be fixed, a few more to go in registry proxies controller test. There are quite a few mocks to deal with :) |
d49002b
to
e530777
Compare
I made a bunch of test updates. I also made the decision that |
e530777
to
35a6448
Compare
35a6448
to
17d1606
Compare
…ntainerRespositories to container repos
17d1606
to
7e02baa
Compare
Everything looks good here..Was able to go through the general CV workflows with container push repos. One note above which is because after deleting the product, I was left with a container repo in pulp untracked by katello. |
Interesting, was the DeleteDistributions step skipped? If it is, then the Pulp repository won't get deleted. I'm curious if you can consistently reproduce the issue. |
Will retrace the steps but I think it wa the library push repo without any CVs that I tried deleting first and it left the library repo in pulp. |
So I tried reproducing and it happens only when the repo push actually fails. For ex: I tried a push with a v1 manifest podman pull quay.io/aptible/hello-world . That created the repo in katello/pulp and then deleting the katello repo left a pulp repo. |
98b2d5d
to
36b4afb
Compare
@sjha4 I fixed the issue by allowing distributions to get looked up even if the manifest push part fails. Previously, the blob upload would succeed but the manifest upload would fail. This caused a Pulp repo to get created that Katello wasn't keeping proper track of. |
I think there is a workflow that leads to an orphaned pulp repo. If you push a container repo, publish it in a CV version and then delete the repository from the repo details page while selecting remove from all CV versions, there is still a repo left in pulp db after the task. All the distributions get deleted though. |
I did a bit of digging and found out this is the normal behavior for published repositories in general. I was able to reproduce the same thing on a yum repository with filtered content. If actual repository copies are made, some empty shell of a repository is always left behind. When orphaned cleanup happens, all of its repository versions get deleted and just the repository is left. Take a look at https://github.com/Katello/katello/blob/master/app/lib/actions/pulp3/orchestration/repository/delete.rb This is explained a bit in here: #8594 It seems that logic came from the fact that, if you deleted the CV version and it deleted the entire repository, it would break other CV versions. The next question is then, what should we do about this bug(?). The repo shells left behind don't take up any space, but they do take up database entries and potential backend_object_name resources. We might be able to delete these orphaned repositories if they have no repository versions left. Or, we could improve the repo deletion logic to determine that we are trying to purge this repository and thus delete all cloned repository versions. I'm inclined to make this a separate issue and deal with it outside the scope of this PR so it's not rushed. Touching our repo deletion logic will need some special attention since it's a bit complicated. |
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.
Ack..let's revisit the orphaned repo issue separately.
This PR looks good and works well..Able to do the usual push, repository and CV operations. 🚢
What are the changes introduced in this pull request?
Considerations taken when implementing this change?
Other update actions on container push repositories will cause weirdness. I considered fixing that here too, but I think it'll be better for another PR. We'll need to change up the repo edit UI for container push repos.
What are the testing steps for this pull request?