From 2c6bc6d7a319bdc6dc6c15a3a880c8b2d5d450dd Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 21 Apr 2023 10:19:40 -0700 Subject: [PATCH] Move containerfile setting in container build When setting the containerfile variable, we need to be inside the zk_images loop in order to set the correct default for each image. Change-Id: I216ffd19dd797752b2e5ca2332e651b8e6ac8a3c --- roles/build-container-image/tasks/build.yaml | 4 ++++ roles/build-container-image/tasks/buildx.yaml | 4 ++++ roles/build-container-image/tasks/main.yaml | 4 ---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/roles/build-container-image/tasks/build.yaml b/roles/build-container-image/tasks/build.yaml index dbc7db8b7..0b7f9e53d 100644 --- a/roles/build-container-image/tasks/build.yaml +++ b/roles/build-container-image/tasks/build.yaml @@ -1,3 +1,7 @@ +- name: Set container filename arg + set_fact: + containerfile: "{{ zj_image.container_filename | default(container_filename) | default('') }}" + - name: Set up siblings include_tasks: siblings.yaml diff --git a/roles/build-container-image/tasks/buildx.yaml b/roles/build-container-image/tasks/buildx.yaml index c710585c6..9c90de89b 100644 --- a/roles/build-container-image/tasks/buildx.yaml +++ b/roles/build-container-image/tasks/buildx.yaml @@ -8,6 +8,10 @@ set_fact: _repopath: "{{ (zj_image.repository | split('/', 1)).1 }}" +- name: Set container filename arg + set_fact: + containerfile: "{{ zj_image.container_filename | default(container_filename) | default('') }}" + - name: Set up siblings include_tasks: siblings.yaml diff --git a/roles/build-container-image/tasks/main.yaml b/roles/build-container-image/tasks/main.yaml index 40f4880cf..84bb82c79 100644 --- a/roles/build-container-image/tasks/main.yaml +++ b/roles/build-container-image/tasks/main.yaml @@ -38,10 +38,6 @@ buildset_registry_alias: "{{ buildset_registry.host }}" when: buildset_registry is defined and not ( buildset_registry.host | ipaddr ) -- name: Set container filename arg - set_fact: - containerfile: "{{ zj_image.container_filename | default(container_filename) | default('') }}" - - name: Determine if we are building multiarch or not set_fact: _multiarch: "{{ container_images | selectattr('arch', 'defined') | list }}"