Issue #3462
closedPulp produces incorrect crane json for removed tags
Description
Reproducer:
#create repo
pulp-admin docker repo create --repo-id reproducer-repo --feed https://osbs-pulp-stage.host.prod.eng.rdu2.redhat.com:8888/ --upstream-name twaugh/rsyslog
#Sync repo with schema 2 content with more then 1 tag
pulp-admin docker repo sync run --repo-id <some_repo_id>
- check for synced tags
pulp-admin docker repo search tag --repo-id reproducer-repo
- remove one tag by name
pulp-admin docker repo remove tag --repo-id reproducer-repo --match 'name=<tag>'
#make sure only selected tag was removed
#publish the repo
pulp-admin docker repo publish run --repo-id reproducer-repo
#on pulp server
cat /var/lib/pulp/published/docker/v2/master/reproducer-repo/*/reproducer-repo.json | python -m json.tool
And in output you can see that removed tag is still in
"manifest_list_amd64_tags"
Tag is also pullable via "docker pull"
however tag is not present in
$ cat /var/lib/pulp/published/docker/v2/master/reproducer-repo/*/tags/list | python -m json.tool
neither is in published manifests
Pulp docker version: pulp-docker-plugins-3.1.1-2
Files
Delete tags when unassociated from repository
Each tag exists in only a single repository, so when they are removed, they are automatically orphaned. By cleaning them up when they are removed, we solve a problem in which orphaned tags were erroneously published.
fixes #3462
https://pulp.plan.io/issues/3462