Skip to content

[Feature] artifacts referring to subjects in different repositories #586

@Silvanoc

Description

@Silvanoc

Current Behavior

regctl artifact put --subject <subject-ref> <artifact-ref> fails with reference and subject must be in the same repository if artifact-ref and subject-ref are on different repositories, but in the same registry

Expected Behavior

artifact-ref and subject-ref on the same registry are accepted, no matter if they are on different repositories or not.

Steps To Reproduce

Following script:

#!/usr/bin/env bash

set -eu

cleanup() {
    docker rm -f test-subject
}

trap cleanup EXIT

docker run -d -p 5123:5000 --name test-subject ghcr.io/project-zot/zot-linux-arm64:latest
sleep 3

regctl registry set --tls disabled

dd if=/dev/urandom of=./artifact.file bs=1M count=10

skopeo copy --override-os linux --dest-tls-verify=false docker://docker.io/library/alpine:3.18.4 docker://localhost:5123/alpine:3.18.4

echo
echo "🤨 does putting an artifact work?"
regctl artifact put --file ./artifact.file localhost:5123/alpine:v1
echo "✅ Putting an artifact works"

echo
echo "🤨 does putting an artifact with a subject in the same repository work?"
regctl artifact put --subject localhost:5123/alpine:3.18.4 --file ./artifact.file localhost:5123/alpine:v2
echo "✅ Putting an artifact with a subject in the same repository works"

echo
echo "🤨 does putting an artifact with a subject in a different repository work?"
regctl artifact put --subject localhost:5123/alpine:3.18.4 --file ./artifact.file localhost:5123/the-subject-repo:v1
echo "✅ Putting an artifact with a subject in a different repository works"

Version

VCSTag:     v0.5.3
VCSRef:     63bcd1a551acbb357d6a6aea0c50fb193aa77da9
VCSCommit:  63bcd1a551acbb357d6a6aea0c50fb193aa77da9
VCSState:   clean
VCSDate:    2023-10-06T20:40:08Z
Platform:   darwin/arm64
GoVer:      go1.21.1
GoCompiler: gc

Environment

  • Running as binary or container: as binary
  • Host platform: MacOS
  • Registry description: Zot

Anything else

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions