Issue #7046
closedAdding a distribution tree to another repo doesn't work correctly
Description
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:="..."
)
Result:
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.
Related issues
Updated by daviddavis over 4 years 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.
Updated by dkliban@redhat.com over 4 years 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.
Updated by ttereshc over 4 years ago
- Sprint/Milestone set to Pulp 3.x RPM (Katello 4.1)
Updated by daviddavis over 4 years 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.
Updated by ttereshc over 4 years ago
- Related to Issue #6950: Migration of a distribution tree fails when it is present in multiple repos added
Updated by ttereshc over 4 years ago
- Related to Task #7150: Do not have FK pointing to a main repo from a DistributionTree Variant added
Added by ttereshc over 4 years ago
Updated by ttereshc over 4 years ago
- Status changed from NEW to MODIFIED
Applied in changeset ca39e84c97a2bf96025b80cde4576fd4e720a61b.
Updated by ttereshc over 4 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Updated by ttereshc over 4 years ago
- Sprint/Milestone changed from Pulp 3.x RPM (Katello 4.1) to Pulp RPM 3.5.0
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.
closes #7150 https://pulp.plan.io/issues/7150
closes #7096 https://pulp.plan.io/issues/7096
closes #7046 https://pulp.plan.io/issues/7046
[nocoverage]