Adding a distribution tree to another repo doesn't work correctly
Steps to recreate:
- Create a repo A and sync down a distribution tree such as centos 8
- Create a new repo B
- Add the distribution tree to your new repo B (
http :/pulp/api/v3/repositories/rpm/rpm/.../modify/ add_content_units:="...")
The new repo B now has a distribution tree whose BaseOS variant points to the original repo A that synced down the tree. Moreover, repo A shows it has a number of packages/etc while B only has one content unit.
I think this could lead to strange situations where for example repo A can be deleted which would mess up the kickstart.
Remove FK to the main repo from a distribution tree Variant.
No issues with repository removal. No issues with copying the same distribution tree into multiple repos.
#1 Updated by daviddavis 10 months ago
I discovered this issue while working on exporting distribution trees. The problem I am currently dealing with is the circular graph that we create whereby a repo contains a distribution tree which in turn points to the repo itself. I'd probably recommend we create a new subrepo for each variant/addon instead of using the original repo to store distribution tree content.
#7 Updated by daviddavis 10 months ago
The copy (via modify API or recursive copy API) of a DistributionTree should create a new DistributionTree instance that references the new repository. This operation should also copy all the RPMs associated with the source repository.
I don't think this fully solves the problem. Consider the following scenarios:
- Can a user delete a repository that has a DistributionTree? I think this is a problem since the DistributionTree has a foreign key to the repo (edit: This has been raised as #7096)
- What happens when a user removes a DistributionTree from a repo?
- What happens when a user removes a DistributionTree from a repo and then adds it to another repo?
- What happens if I copy over a DistributionTree that already exists in the destination repo? I'm thinking this might happen in the promotion workflow.
Please register to edit this issue