Project

Profile

Help

Issue #7046

Adding a distribution tree to another repo doesn't work correctly

Added by daviddavis 3 months ago. Updated about 2 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Katello
Sprint:
Quarter:

Description

Steps to recreate:

  1. Create a repo A and sync down a distribution tree such as centos 8
  2. Create a new repo B
  3. 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

Related to Migration Plugin - Issue #6950: Migration of a distribution tree fails when it is present in multiple reposCLOSED - CURRENTRELEASE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Related to RPM Support - Task #7150: Do not have FK pointing to a main repo from a DistributionTree Variant CLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision ca39e84c View on GitHub
Added by ttereshc about 2 months ago

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]

History

#1 Updated by daviddavis 3 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.

#2 Updated by daviddavis 3 months ago

  • Description updated (diff)

#3 Updated by dkliban@redhat.com 3 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.

#4 Updated by ttereshc 3 months ago

  • Triaged changed from No to Yes

#5 Updated by ttereshc 3 months ago

  • Sprint/Milestone set to Pulp 3.x RPM (Katello 4.1)

#6 Updated by ttereshc 3 months ago

  • Priority changed from Normal to High

#7 Updated by daviddavis 3 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.

#8 Updated by ttereshc 3 months ago

  • Related to Issue #6950: Migration of a distribution tree fails when it is present in multiple repos added

#9 Updated by jsherril@redhat.com 3 months ago

  • Tags Katello added

#10 Updated by ttereshc 2 months ago

  • Related to Task #7150: Do not have FK pointing to a main repo from a DistributionTree Variant added

#11 Updated by ttereshc about 2 months ago

  • Status changed from NEW to MODIFIED

#12 Updated by ttereshc about 2 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

#13 Updated by ttereshc about 2 months ago

  • Sprint/Milestone changed from Pulp 3.x RPM (Katello 4.1) to Pulp RPM 3.5.0

Please register to edit this issue

Also available in: Atom PDF