From 8e94966226309f4a00c4e86cef27bbe7f6f7a47f Mon Sep 17 00:00:00 2001 From: Bruno FS Ciconelle Date: Tue, 14 Jan 2025 16:28:50 -0300 Subject: [PATCH] ci(konflux): make labels customizable With default values pointing for upstream values. --- .tekton/discovery-ui-pull-request.yaml | 2 ++ .tekton/discovery-ui-push.yaml | 2 ++ .tekton/downstream-build-arguments.conf | 6 ++++++ Containerfile | 20 +++++++++++++------- 4 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 .tekton/downstream-build-arguments.conf diff --git a/.tekton/discovery-ui-pull-request.yaml b/.tekton/discovery-ui-pull-request.yaml index e863b126..6b21ae85 100644 --- a/.tekton/discovery-ui-pull-request.yaml +++ b/.tekton/discovery-ui-pull-request.yaml @@ -36,6 +36,8 @@ spec: value: "true" - name: prefetch-input value: '{"type": "npm", "path": "."}' + - name: build-args-file + value: ".tekton/downstream-build-arguments.conf" pipelineSpec: description: | This pipeline is ideal for building container images from a Containerfile while reducing network traffic. diff --git a/.tekton/discovery-ui-push.yaml b/.tekton/discovery-ui-push.yaml index 292f9543..07b733d1 100644 --- a/.tekton/discovery-ui-push.yaml +++ b/.tekton/discovery-ui-push.yaml @@ -33,6 +33,8 @@ spec: value: "true" - name: prefetch-input value: '{"type": "npm", "path": "."}' + - name: build-args-file + value: ".tekton/downstream-build-arguments.conf" pipelineSpec: description: | This pipeline is ideal for building container images from a Containerfile while reducing network traffic. diff --git a/.tekton/downstream-build-arguments.conf b/.tekton/downstream-build-arguments.conf new file mode 100644 index 00000000..798ab9d0 --- /dev/null +++ b/.tekton/downstream-build-arguments.conf @@ -0,0 +1,6 @@ +K8S_DESCRIPTION=Discovery UI +K8S_DISPLAY_NAME=discovery-ui +K8S_NAME=discovery/discovery-ui-rhel9 +OCP_TAGS=discovery +QUIPUCORDS_BRANDED=true +REDHAT_COMPONENT=discovery-ui-container diff --git a/Containerfile b/Containerfile index bcbb4dcd..588111e1 100644 --- a/Containerfile +++ b/Containerfile @@ -14,6 +14,12 @@ COPY . . RUN export UI_BRAND=${QUIPUCORDS_BRANDED}; npm run build FROM registry.access.redhat.com/ubi9/nginx-122 +ARG K8S_DESCRIPTION="Quipucords UI" +ARG K8S_DISPLAY_NAME="quipucords-ui" +ARG K8S_NAME="quipucords/quipucords-ui" +ARG OCP_TAGS="quipucords" +ARG REDHAT_COMPONENT="quipucords-ui-container" + # original NGINX user; update if the number ever change # https://github.com/sclorg/nginx-container/blob/e7d8db9bc5299a4c4e254f8a82e917c7c136468b/1.22/Dockerfile.rhel9#L84 ENV NGINX_USER=1001 @@ -31,10 +37,10 @@ USER ${NGINX_USER} CMD ["/bin/bash", "/opt/app-root/entrypoint.sh"] -LABEL com.redhat.component="discovery-ui-container" \ - description="Discovery UI" \ - io.k8s.description="Discovery UI" \ - io.k8s.display-name="discovery-ui" \ - io.openshift.tags="discovery" \ - name="discovery/discovery-ui-rhel9" \ - summary="Discovery UI" +LABEL com.redhat.component=${REDHAT_COMPONENT} \ + description=${K8S_DESCRIPTION} \ + io.k8s.description=${K8S_DESCRIPTION} \ + io.k8s.display-name=${K8S_DISPLAY_NAME} \ + io.openshift.tags=${OCP_TAGS} \ + name=${K8S_NAME} \ + summary=${K8S_DESCRIPTION}