Project

Profile

Help

Issue #5656

closed

Creating a FileRemote and RpmRemote with the same name raises an error

Added by daviddavis over 4 years ago. Updated over 3 years ago.

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

Description

Steps to reproduce:

$ http :/pulp/api/v3/remotes/file/file/ name=rebecca_black url="http://friday/"
$ http :/pulp/api/v3/remotes/rpm/rpm/ name=rebecca_black url="http://friday/"

The problem is that uniqueness across base fields on Master/Detail models are scoped universally instead of per type.

Possible Solutions:
1. Keep it the way it is with universal uniqueness. This is what Pulp 2 does (for repos at least).
2. Use unique_together to enforce unique constraints per pulp_type[0]
3. Remove these unique constraints completely and allow for instance dupe FileRemote names

[0] I think django 2.2+ actually recommends using Constraints now: https://docs.djangoproject.com/en/2.2/ref/models/options/#django.db.models.Options.constraints

Actions #1

Updated by daviddavis over 4 years ago

  • Description updated (diff)
Actions #2

Updated by mdellweg over 4 years ago

In ansible modules for pulp, this name is used as a natural key for entities. So some kind of uniqueness is desparately needed there in order to describe remotes (and other entities) in an idempotent way.
I don't really care much about 1 vs. 2, but please do not use option 3.

Actions #3

Updated by fao89 over 4 years ago

  • Triaged changed from No to Yes
Actions #4

Updated by dkliban@redhat.com over 3 years ago

  • Status changed from NEW to CLOSED - WONTFIX

We need to finish planning this feature.

Also available in: Atom PDF