Skip to content

base_path uniqueness constraint prevents syncing the same image from multiple remote registries #2495

Description

@Katakam-Rakesh

Summary

When the same container image path (e.g. library/mysql) is synced from
multiple remote registries, Pulp rejects the second and subsequent
distributions with a base_path uniqueness error.

Tags from the same image across different registries cannot be served
under a single distribution.


Current Behaviour

Remote registry Image Derived base_path Result
docker.io library/mysql library/mysql ✅ Created
100.10.1.114:443 library/mysql library/mysql ❌ Rejected
100.10.1.114:3445 library/mysql library/mysql ❌ Rejected

Error returned:

{"base_path": ["This field must be unique."]}

Note: Multiple tags of the same image from the same registry sync
and distribute correctly. The issue only occurs when different remote
registries
provide tags for the same image path.


Expected Behaviour

If tags are coming from different registries for the same image, Pulp
should support serving them through the same distribution with the same
base_path. The unified tag list from all upstream sources should be
accessible to clients under a single namespace.


Reproduction Steps

# 1. Create remote A (public registry)
pulp container remote create \
  --name "mysql-dockerhub" \
  --upstream-name "library/mysql" \
  --url "https://registry-1.docker.io" \
  --include-tags "8.0 8.4"

# 2. Sync remote A → repo A
pulp container repository create --name "mysql-a"
pulp container repository sync --name "mysql-a" --remote "mysql-dockerhub"

# 3. Create distribution A  →  succeeds
pulp container distribution create \
  --name "mysql-dist" \
  --base-path "library/mysql" \
  --repository "mysql-a"

# 4. Create remote B (private registry, different tags)
pulp container remote create \
  --name "mysql-private" \
  --upstream-name "library/mysql" \
  --url "https://100.10.1.114:443" \
  --include-tags "8.0-custom 8.4-patched"

# 5. Sync remote B → repo B
pulp container repository create --name "mysql-b"
pulp container repository sync --name "mysql-b" --remote "mysql-private"

# 6. Create distribution B  →  FAILS
pulp container distribution create \
  --name "mysql-dist-private" \
  --base-path "library/mysql" \
  --repository "mysql-b"
# ERROR: {"base_path": ["This field must be unique."]}

Related Issues


Use Case

In enterprise environments it is common to mirror the same image from
multiple upstream registries (public + private, or primary + DR site) and
present them behind a single namespace to consumers. Currently there is
no way to achieve this in Pulp when the image path is identical across
registries.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions