From e8cc0b54ed2fd5c5c98975aed4a342c09fec7fa9 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 2 Jul 2021 16:58:48 -0700 Subject: [PATCH] Ignore errors when deleting tags from dockerhub We've seen a case where we can still push and pull tags from dockerhub, but the web UI and API seem out of sync with the actual registry. In this case, we would like to continue, even though it will leave some unused tags in the repo (they can be cleaned up later if they ever show up). Change-Id: If000163a321c869c46cfed4233c2ea42c3e8471b --- roles/promote-docker-image/tasks/promote-retag-inner.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roles/promote-docker-image/tasks/promote-retag-inner.yaml b/roles/promote-docker-image/tasks/promote-retag-inner.yaml index f3fc4b970..0c8ba5ab2 100644 --- a/roles/promote-docker-image/tasks/promote-retag-inner.yaml +++ b/roles/promote-docker-image/tasks/promote-retag-inner.yaml @@ -23,6 +23,9 @@ Authorization: "Bearer {{ token.json.token }}" - name: Delete the current change tag no_log: true + # In case the dockerhub API is out of sync with the registry, let's + # continue anyway. + failed_when: false uri: url: "https://hub.docker.com/v2/repositories/{{ zj_image.repository }}/tags/{{ promote_tag_prefix }}_{{ zj_image_tag }}/" method: DELETE