Project

Profile

Help

Issue #7046

closed

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

Added by daviddavis over 4 years ago. Updated over 4 years 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 - CURRENTRELEASEttereshcActions
Related to RPM Support - Task #7150: Do not have FK pointing to a main repo from a DistributionTree Variant CLOSED - CURRENTRELEASEttereshc

Actions
Actions #1

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.

Actions #2

Updated by daviddavis over 4 years ago

  • Description updated (diff)
Actions #3

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.

Actions #4

Updated by ttereshc over 4 years ago

  • Triaged changed from No to Yes
Actions #5

Updated by ttereshc over 4 years ago

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

Updated by ttereshc over 4 years ago

  • Priority changed from Normal to High
Actions #7

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.
Actions #8

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
Actions #9

Updated by jsherril@redhat.com over 4 years ago

  • Tags Katello added
Actions #10

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

Revision ca39e84c | View on GitHub

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]

Actions #11

Updated by ttereshc over 4 years ago

  • Status changed from NEW to MODIFIED
Actions #12

Updated by ttereshc over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions #13

Updated by ttereshc over 4 years ago

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

Also available in: Atom PDF