From 613a6ce85fdf30b2d4efb3584765f41c9acd69bc Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Mon, 11 Apr 2022 15:22:00 -0400 Subject: [PATCH] build-docker-image: Fix buildset registry pushes If we build an image with `docker_registry` set, it will fail to tag the image for the buildset registry since we do not prefix the image with `docker_registry` when retagging it (if set). This patch resolves this by adding that prefix if it is set so it will refer to an image that exists. Change-Id: Iba29161156c8e8ff4f79a92771456cf105d780fe --- roles/build-docker-image/tasks/push.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/build-docker-image/tasks/push.yaml b/roles/build-docker-image/tasks/push.yaml index 8364c3951..c3cfc2f1c 100644 --- a/roles/build-docker-image/tasks/push.yaml +++ b/roles/build-docker-image/tasks/push.yaml @@ -1,6 +1,6 @@ - name: Tag image for buildset registry command: >- - docker tag {{ zj_image.repository }}:{{ zj_image_tag }} {{ buildset_registry_alias }}:{{ buildset_registry.port }}/{{ zj_image.repository }}:{{ zj_image_tag }} + docker tag {{ docker_registry | ternary(docker_registry + '/', '') }}{{ zj_image.repository }}:{{ zj_image_tag }} {{ buildset_registry_alias }}:{{ buildset_registry.port }}/{{ zj_image.repository }}:{{ zj_image_tag }} loop: "{{ zj_image.tags | default(['latest']) }}" loop_control: loop_var: zj_image_tag