From 839de7f8996838162ae0de6a9f6ba28f968381bc Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Mon, 1 May 2023 10:13:32 -0700 Subject: [PATCH] Add labels to build-container-image The "docker build" path is missing the "--label" arguments which are present in all other paths (docker buildx in both build-container-image and build-docker-image roles). This means that images are being built without expected metadata labels. This change adds the extra arguments to match. Change-Id: I607ae89cace87fe87b6dcfb95a1bae4fca516d3c --- roles/build-container-image/tasks/build.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/roles/build-container-image/tasks/build.yaml b/roles/build-container-image/tasks/build.yaml index 0b7f9e53d..5c3752484 100644 --- a/roles/build-container-image/tasks/build.yaml +++ b/roles/build-container-image/tasks/build.yaml @@ -26,6 +26,13 @@ --tag {{ zj_image.repository }}:{{ tag_prefix }}{{ tag }} --tag {{ zj_image.repository }}:{{ tag }} {% endfor -%} + {% for label in zj_image.labels | default([]) -%} + --label "{{ label }}" + {% endfor %} + {% if zuul.change | default(false) -%} + --label "org.zuul-ci.change={{ zuul.change }}" + {% endif -%} + --label "org.zuul-ci.change_url={{ zuul.change_url }}" args: chdir: "{{ zuul_work_dir }}/{{ zj_image.context }}" environment: "{{ container_build_extra_env }}"