Project

General

Profile

Actions

Bug #17317

closed

Associating docker tag with incorrect docker manifest.

Added by Thomas McKay over 7 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Container
Target version:
Fixed in Releases:
Found in Releases:

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.

Actions #1

Updated by Thomas McKay over 7 years ago

  • Bugzilla link set to 1394313
Actions #2

Updated by Thomas McKay over 7 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

Actions #3

Updated by Partha Aji over 7 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])
       end

What we should be doing is
  1. import the manifests (ignore the Tag field)
  2. import the tags as a separate step
  3. use digest on tag to point it to the manifest (associate it there)
Actions #4

Updated by The Foreman Bot over 7 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
Actions #5

Updated by Justin Sherrill over 7 years ago

  • translation missing: en.field_release set to 114
Actions #6

Updated by The Foreman Bot over 7 years ago

  • translation missing: en.field_release deleted (114)
Actions #7

Updated by The Foreman Bot over 7 years ago

  • Pull request https://github.com/Katello/katello/pull/6486 added
Actions #8

Updated by The Foreman Bot over 7 years ago

  • Pull request https://github.com/Katello/katello/pull/6473 added
Actions #9

Updated by Thomas McKay over 7 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #10

Updated by Brad Buckingham over 7 years ago

  • Target version set to 147
Actions #11

Updated by Eric Helms over 7 years ago

  • Pull request deleted (https://github.com/Katello/katello/pull/6454)
Actions #12

Updated by Justin Sherrill over 7 years ago

  • translation missing: en.field_release set to 188
Actions

Also available in: Atom PDF