From b2b5ba1f2728d72a86b9709d3b208e6770cd871a Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 1 Jul 2020 15:37:58 -0700 Subject: [PATCH] Handle multi-arch docker manifests in promote A multi-arch manifist is a manifest list which has a different content-type than a regular manifest. In order to re-tag the image correctly, tell docker hub that we can accept both kinds of manifests, and re-upload the one that it gives us. This will be a manifest list if it exists, or a regular manifest if it doesn't. Change-Id: I7863b0c824c0b3cb20f94ba67399e823a216092b --- roles/promote-docker-image/tasks/promote-retag-inner.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/promote-docker-image/tasks/promote-retag-inner.yaml b/roles/promote-docker-image/tasks/promote-retag-inner.yaml index 6f51326d8..8ddcbaaa4 100644 --- a/roles/promote-docker-image/tasks/promote-retag-inner.yaml +++ b/roles/promote-docker-image/tasks/promote-retag-inner.yaml @@ -4,7 +4,7 @@ url: "https://registry.hub.docker.com/v2/{{ zj_image.repository }}/manifests/change_{{ zuul.change }}_{{ zj_image_tag }}" status_code: 200 headers: - Accept: "application/vnd.docker.distribution.manifest.v2+json" + Accept: "application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.docker.distribution.manifest.v2+json" Authorization: "Bearer {{ token.json.token }}" return_content: true register: manifest @@ -16,7 +16,7 @@ status_code: 201 body: "{{ manifest.content | string }}" headers: - Content-Type: "application/vnd.docker.distribution.manifest.v2+json" + Content-Type: "{{ manifest.content_type }}" Authorization: "Bearer {{ token.json.token }}" - name: Delete the current change tag no_log: true