From 5b37cabf4162cfa78b1d626571555874c139b4f3 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Wed, 29 Apr 2020 20:04:09 -0400 Subject: [PATCH] Fix incorrect variable name for promote-docker-image The variable was changed inside the role from image to zj_image but the included task file did not use the new variable name. This patch fixes this. Change-Id: Ibe3acbd0881da24ec9c2f636d777885a309bdf98 --- roles/promote-docker-image/tasks/promote-cleanup.yaml | 4 ++-- roles/promote-docker-image/tasks/promote-retag-inner.yaml | 6 +++--- roles/promote-docker-image/tasks/promote-retag.yaml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/promote-docker-image/tasks/promote-cleanup.yaml b/roles/promote-docker-image/tasks/promote-cleanup.yaml index 4755361ce..79b1066f1 100644 --- a/roles/promote-docker-image/tasks/promote-cleanup.yaml +++ b/roles/promote-docker-image/tasks/promote-cleanup.yaml @@ -1,6 +1,6 @@ - name: List tags uri: - url: "https://hub.docker.com/v2/repositories/{{ image.repository }}/tags?page_size=1000" + url: "https://hub.docker.com/v2/repositories/{{ zj_image.repository }}/tags?page_size=1000" status_code: 200 register: tags - name: Set cutoff timestamp to 24 hours ago @@ -13,7 +13,7 @@ loop_var: zj_docker_tag when: zj_docker_tag.last_updated < cutoff.stdout and zj_docker_tag.name.startswith('change_') uri: - url: "https://hub.docker.com/v2/repositories/{{ image.repository }}/tags/{{ zj_docker_tag.name }}/" + url: "https://hub.docker.com/v2/repositories/{{ zj_image.repository }}/tags/{{ zj_docker_tag.name }}/" method: DELETE status_code: [200,204] headers: diff --git a/roles/promote-docker-image/tasks/promote-retag-inner.yaml b/roles/promote-docker-image/tasks/promote-retag-inner.yaml index 3d4d73391..4701ee42e 100644 --- a/roles/promote-docker-image/tasks/promote-retag-inner.yaml +++ b/roles/promote-docker-image/tasks/promote-retag-inner.yaml @@ -1,7 +1,7 @@ - name: Get manifest no_log: true uri: - url: "https://registry.hub.docker.com/v2/{{ image.repository }}/manifests/change_{{ zuul.change }}_{{ image_tag }}" + url: "https://registry.hub.docker.com/v2/{{ zj_image.repository }}/manifests/change_{{ zuul.change }}_{{ image_tag }}" status_code: 200 headers: Accept: "application/vnd.docker.distribution.manifest.v2+json" @@ -11,7 +11,7 @@ - name: Put manifest no_log: true uri: - url: "https://registry.hub.docker.com/v2/{{ image.repository }}/manifests/{{ image_tag }}" + url: "https://registry.hub.docker.com/v2/{{ zj_image.repository }}/manifests/{{ image_tag }}" method: PUT status_code: 201 body: "{{ manifest.content | string }}" @@ -21,7 +21,7 @@ - name: Delete the current change tag no_log: true uri: - url: "https://hub.docker.com/v2/repositories/{{ image.repository }}/tags/change_{{ zuul.change }}_{{ image_tag }}/" + url: "https://hub.docker.com/v2/repositories/{{ zj_image.repository }}/tags/change_{{ zuul.change }}_{{ image_tag }}/" method: DELETE status_code: [200,204] headers: diff --git a/roles/promote-docker-image/tasks/promote-retag.yaml b/roles/promote-docker-image/tasks/promote-retag.yaml index 043cfbb91..1dd5e8a2c 100644 --- a/roles/promote-docker-image/tasks/promote-retag.yaml +++ b/roles/promote-docker-image/tasks/promote-retag.yaml @@ -7,7 +7,7 @@ force_basic_auth: true register: token - name: Retag image - loop: "{{ image.tags | default(['latest']) }}" + loop: "{{ zj_image.tags | default(['latest']) }}" loop_control: loop_var: image_tag include_tasks: promote-retag-inner.yaml