Bug #17317
closedAssociating docker tag with incorrect docker manifest.
Description
When a manifest changes for a tag and the repo is synced, existing tag relations incorrectly point to this new manifest.
To reproduce:
+ start a local registry (thomasmckay-desktop.usersys.redhat.com:5000 in this example)
docker run --rm -it -p 5000:5000 registry:2
+ create dockerfiles
v1/Dockerfile
FROM registry.access.redhat.com/rhel7/rhel
RUN echo "Here we go, vertigo" > sounds.txt
ENTRYPOINT ["cat", "sounds.txt"]
v2/Dockerfile
FROM katello.example.com:5000/examplecorp-production-test-for-echo-test-for-echo-test-for-echo:v1
RUN echo "Video vertigo" >> sounds.txt
RUN echo "Test for echo" >> sounds.txt
ENTRYPOINT ["cat", "sounds.txt"]
+ build v1 and push to local registry
docker build --tag thomasmckay-desktop.usersys.redhat.com:5000/thomasmckay/test-for-echo:v1 v1
docker push thomasmckay-desktop.usersys.redhat.com:5000/thomasmckay/test-for-echo
+ create docker repo test-for-echo and sync thomasmckay-desktop.usersys.redhat.com:5000/thomasmckay/test-for-echo
note 1 tag, 1 manifest
+ create content view w/ this repo
+ publish cv and promote to lifecycle env
+ visit docker tags page and note environments present
+ build v2 image, push, and resync repo
docker build --tag thomasmckay-desktop.usersys.redhat.com:5000/thomasmckay/test-for-echo:v2 v2
+ re-publish cv
note 2 tags, 2 manifests
note docker tags page correct
+ tag v2 as v1, push to local registry, resync repo, publish cv
docker tag b80dafd4d227 thomasmckay-desktop.usersys.redhat.com:5000/thomasmckay/test-for-echo:v1
docker push thomasmckay-desktop.usersys.redhat.com:5000/thomasmckay/test-for-echo
note 2 tags, 3 manifests
note docker tags page for v1 shows it in Library, Default Organization View, and Production (my lifecycle env)
From the UI there is no way to tell that these are different images for the same tag:
Library and Default Organzation View = new v1
Production = original v1
There should be 3 tags in katello, with the 2 v1 tags pointing to separate manifests.
This makes it impossible to use katello as a way to manage images.
Updated by Thomas McKay about 8 years ago
$ pulp-admin --user admin --password admin docker repo search tag --repo-id examplecorp-test-for-echo-test-for-echo Created: 2016-11-11T15:45:30Z Metadata: Manifest Digest: sha256:c3d77f5ad51dd80d641313d245ad568d31c7c8be1ba13eb4294 a182550dd052a Name: v2 Pulp User Metadata: Repo Id: examplecorp-test-for-echo-test-for-echo Repo Id: examplecorp-test-for-echo-test-for-echo Unit Id: a7b6eef3-b2a1-40a1-a45e-039d738ff48b Unit Type Id: docker_tag Updated: 2016-11-11T15:54:59Z Created: 2016-11-11T15:34:22Z Metadata: Manifest Digest: sha256:aeb8aa0ca60a6856e7454ed9d613d687071bdad69ffcf930d13 8427c062c4d42 Name: v1 Pulp User Metadata: Repo Id: examplecorp-test-for-echo-test-for-echo Repo Id: examplecorp-test-for-echo-test-for-echo Unit Id: b2ab8db5-713b-4442-8219-d386e3e16648 Unit Type Id: docker_tag Updated: 2016-11-11T15:54:59Z $ pulp-admin --user admin --password admin docker repo search manifest --repo-id examplecorp-test-for-echo-test-for-echo Created: 2016-11-11T15:34:22Z Metadata: Digest: sha256:33a09bf862ed149d4a440223f40b15ba0533e44793e50507714 27c333b7e65fc Downloaded: True Fs Layers: Blob Sum: sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955 b46d4 Blob Sum: sha256:eb13c8489451ee821029d04a89e03a907601aa4fa7d080010bc257c2000 f6d05 Blob Sum: sha256:9b0dee6356a152d6cbac4adf6ce40ae4df40442d559931862ad65c78ed3 73979 Blob Sum: sha256:972548a33962c6f466128fc90db5d224d8bb5f589ffd9a998a43f323c71 11cf5 Name: thomasmckay/test-for-echo Pulp User Metadata: Schema Version: 1 Tag: v1 Repo Id: examplecorp-test-for-echo-test-for-echo Unit Id: 4d63293f-fe50-4d85-851a-165e960cc2c0 Unit Type Id: docker_manifest Updated: 2016-11-11T15:45:29Z Created: 2016-11-11T15:54:59Z Metadata: Digest: sha256:aeb8aa0ca60a6856e7454ed9d613d687071bdad69ffcf930d13 8427c062c4d42 Downloaded: True Fs Layers: Blob Sum: sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955 b46d4 Blob Sum: sha256:7be41db7d4982c9ab735c30f7d4161377bbd9c1c62f18663fb735aad25c 26d13 Blob Sum: sha256:9d14cd52912b66b780666914d986958c0a850733ae4dd72a8c1bb1fb9f3 cf0f3 Blob Sum: sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955 b46d4 Blob Sum: sha256:eb13c8489451ee821029d04a89e03a907601aa4fa7d080010bc257c2000 f6d05 Blob Sum: sha256:9b0dee6356a152d6cbac4adf6ce40ae4df40442d559931862ad65c78ed3 73979 Blob Sum: sha256:972548a33962c6f466128fc90db5d224d8bb5f589ffd9a998a43f323c71 11cf5 Name: thomasmckay/test-for-echo Pulp User Metadata: Schema Version: 1 Tag: v1 Repo Id: examplecorp-test-for-echo-test-for-echo Unit Id: 577eed04-a045-417c-b0a5-d55ad1fb3a99 Unit Type Id: docker_manifest Updated: 2016-11-11T15:54:59Z Created: 2016-11-11T15:45:30Z Metadata: Digest: sha256:c3d77f5ad51dd80d641313d245ad568d31c7c8be1ba13eb4294 a182550dd052a Downloaded: True Fs Layers: Blob Sum: sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955 b46d4 Blob Sum: sha256:7be41db7d4982c9ab735c30f7d4161377bbd9c1c62f18663fb735aad25c 26d13 Blob Sum: sha256:9d14cd52912b66b780666914d986958c0a850733ae4dd72a8c1bb1fb9f3 cf0f3 Blob Sum: sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955 b46d4 Blob Sum: sha256:eb13c8489451ee821029d04a89e03a907601aa4fa7d080010bc257c2000 f6d05 Blob Sum: sha256:9b0dee6356a152d6cbac4adf6ce40ae4df40442d559931862ad65c78ed3 73979 Blob Sum: sha256:972548a33962c6f466128fc90db5d224d8bb5f589ffd9a998a43f323c71 11cf5 Name: thomasmckay/test-for-echo Pulp User Metadata: Schema Version: 1 Tag: v2 Repo Id: examplecorp-test-for-echo-test-for-echo Unit Id: 9abb0705-371a-4b21-9a06-200e0062399b Unit Type Id: docker_manifest Updated: 2016-11-11T15:54:59Z
Updated by Partha Aji about 8 years ago
From what I gather we are using the wrong field to gather tag information
around this line https://github.com/Katello/katello/blob/master/app/models/katello/glue/pulp/repo.rb#L507
def index_db_docker_manifests .... create_docker_tag(manifest, manifest_json[:tag]) endWhat we should be doing is
- import the manifests (ignore the Tag field)
- import the tags as a separate step
- use digest on tag to point it to the manifest (associate it there)
Updated by The Foreman Bot about 8 years ago
- Status changed from New to Ready For Testing
- Assignee set to Thomas McKay
- Pull request https://github.com/Katello/katello/pull/6454 added
Updated by Justin Sherrill about 8 years ago
- Translation missing: en.field_release set to 114
Updated by The Foreman Bot about 8 years ago
- Translation missing: en.field_release deleted (
114)
Updated by The Foreman Bot about 8 years ago
- Pull request https://github.com/Katello/katello/pull/6486 added
Updated by The Foreman Bot about 8 years ago
- Pull request https://github.com/Katello/katello/pull/6473 added
Updated by Thomas McKay about 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset katello|806a8e4e0c19e75cfffb0de96beb0eb3ca3d3794.
Updated by Eric Helms about 8 years ago
- Pull request deleted (
https://github.com/Katello/katello/pull/6454)
Updated by Justin Sherrill about 8 years ago
- Translation missing: en.field_release set to 188