From 510fdd577e138ad722e9d2611d88cfd6c6653c83 Mon Sep 17 00:00:00 2001 From: Andrea Frittoli Date: Wed, 11 Sep 2024 09:09:53 +0100 Subject: [PATCH] Propagate image registry regions to publish And fix the image registry user parameter in publish to be aligned with other parameters. Signed-off-by: Andrea Frittoli --- tekton/publish.yaml | 10 +++++----- tekton/release-pipeline.yaml | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tekton/publish.yaml b/tekton/publish.yaml index 1257e4b9eb9..d000ad0f3a0 100644 --- a/tekton/publish.yaml +++ b/tekton/publish.yaml @@ -22,6 +22,9 @@ spec: - name: imageRegistryRegions description: The target image registry regions default: "us eu asia" + - name: imageRegistryUser + description: Username to be used to login to the container registry + default: "_json_key" - name: releaseAsLatest description: Whether to tag and publish this release as Pipelines' latest default: "true" @@ -30,9 +33,6 @@ spec: default: linux/amd64,linux/arm,linux/arm64,linux/s390x,linux/ppc64le,windows/amd64 - name: serviceAccountPath description: The name of the service account path within the release-secret workspace - - name: registryUser - description: Username to be used to login to the container registry - default: "_json_key" workspaces: - name: source description: >- @@ -54,7 +54,7 @@ spec: - name: CONTAINER_REGISTRY value: "$(params.imageRegistry)/$(params.imageRegistryPath)" - name: CONTAINER_REGISTRY_USER - value: "$(params.registryUser)" + value: "$(params.imageRegistryUser)" - name: REGIONS value: "$(params.imageRegistryRegions)" - name: OUTPUT_RELEASE_DIR @@ -80,7 +80,7 @@ spec: for region in ${REGIONS} do HOSTNAME=${region}.$(params.imageRegistry) - cat ${CONTAINER_REGISTRY_CREDENTIALS} | crane auth login -u _json_key --password-stdin ${HOSTNAME} + cat ${CONTAINER_REGISTRY_CREDENTIALS} | crane auth login -u ${CONTAINER_REGISTRY_USER} --password-stdin ${HOSTNAME} done cp ${DOCKER_CONFIG} /workspace/docker-config.json diff --git a/tekton/release-pipeline.yaml b/tekton/release-pipeline.yaml index 1c0d506a9e8..de14a378d1c 100644 --- a/tekton/release-pipeline.yaml +++ b/tekton/release-pipeline.yaml @@ -166,6 +166,8 @@ spec: value: $(params.imageRegistryPath) - name: imageRegistryUser value: $(params.imageRegistryUser) + - name: imageRegistryRegions + value: $(params.imageRegistryRegions) - name: releaseAsLatest value: $(params.releaseAsLatest) - name: serviceAccountPath