From eb5e16a42a60a4fe5a6aa4a4bdd76292270a022f Mon Sep 17 00:00:00 2001 From: Andrea Frittoli Date: Wed, 8 Jan 2025 12:37:10 +0000 Subject: [PATCH] Fix ghcr.io auth in release A typo in an env variable cause auth failure when pushing to ghcr.io in the release process. Fix that to restore nightly builds and full releases. Add some cosmetic changes to cleanup up the release pipeline log files. Signed-off-by: Andrea Frittoli --- .gitignore | 3 +++ Makefile | 2 +- tekton/build-publish-images-manifests.yaml | 12 +++++------- test/presubmit-tests.sh | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 6c27236e63..eb933b09ef 100644 --- a/.gitignore +++ b/.gitignore @@ -84,3 +84,6 @@ tags # ignore chain certificate test/e2e/common/cosign.pub + +# Release +**/source.tar.gz \ No newline at end of file diff --git a/Makefile b/Makefile index 298b1d38e5..fb741e9d22 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ FORCE_FETCH_RELEASE = false CR = config/basic PLATFORM := $(if $(PLATFORM),--platform $(PLATFORM)) -GOLANGCI_VERSION = v1.57.2 +GOLANGCI_VERSION = v1.63.4 BIN = $(CURDIR)/.bin diff --git a/tekton/build-publish-images-manifests.yaml b/tekton/build-publish-images-manifests.yaml index 16cec06080..9828dd3ca8 100644 --- a/tekton/build-publish-images-manifests.yaml +++ b/tekton/build-publish-images-manifests.yaml @@ -56,7 +56,7 @@ spec: env: - name: "PROJECT_ROOT" value: "$(workspaces.source.path)" - - name: CONTAINER_REGISTY_CREDENTIALS + - name: CONTAINER_REGISTRY_CREDENTIALS value: "$(workspaces.release-secret.path)/$(params.serviceAccountPath)" - name: CONTAINER_REGISTRY value: "$(params.imageRegistry)/$(params.imageRegistryPath)" @@ -89,7 +89,7 @@ spec: for region in ${REGIONS} do HOSTNAME=${region}.$(params.imageRegistry) - cat ${CONTAINER_REGISTY_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/${KUBE_DISTRO}-docker-config.json @@ -129,11 +129,6 @@ spec: fi done - # Rewrite "devel" to params.versionTag - sed -i -e 's/\(operator.tekton.dev\/release\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(app.kubernetes.io\/version\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(version\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\("-version"\), "devel"/\1, "$(params.versionTag)"/g' ${PROJECT_ROOT}/config/base/*.yaml - sed -i -e 's/\(operator.tekton.dev\/release\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(app.kubernetes.io\/version\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(version\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\("-version"\), "devel"/\1, "$(params.versionTag)"/g' ${PROJECT_ROOT}/config/${KUBE_DISTRO}/base/*.yaml - sed -i -e 's/\(operator.tekton.dev\/release\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(app.kubernetes.io\/version\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(version\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\("-version"\), "devel"/\1, "$(params.versionTag)"/g' ${PROJECT_ROOT}/config/${KUBE_DISTRO}/overlays/default/*.yaml - # Publish images and create release.yaml mkdir -p $OUTPUT_RELEASE_DIR @@ -157,6 +152,9 @@ spec: --platform=$(params.platforms) ${KO_EXTRA_ARGS} \ -f - > $OUTPUT_RELEASE_DIR/${FILENAME_PREFIX}release.notags.yaml + # Rewrite "devel" to params.versionTag + sed -i -e 's/\(pipeline.tekton.dev\/release\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(app.kubernetes.io\/version\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(version\): "devel"/\1: "$(params.versionTag)"/g' ${OUTPUT_RELEASE_DIR}/${FILENAME_PREFIX}release.yaml + sed -i -e 's/\(pipeline.tekton.dev\/release\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(app.kubernetes.io\/version\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(version\): "devel"/\1: "$(params.versionTag)"/g' ${OUTPUT_RELEASE_DIR}/${FILENAME_PREFIX}release.notags.yaml - name: koparse image: ghcr.io/tektoncd/plumbing/koparse@sha256:194c2ab9dce5f778ed757af13c626d6b85f15452e2c2902c79b0d0f5a0adf4d1 script: | diff --git a/test/presubmit-tests.sh b/test/presubmit-tests.sh index 6adc100eea..92fcb78fbf 100755 --- a/test/presubmit-tests.sh +++ b/test/presubmit-tests.sh @@ -23,8 +23,8 @@ source $(git rev-parse --show-toplevel)/vendor/github.com/tektoncd/plumbing/scri function check_go_lint() { header "Testing if golint has been done" - # deadline of 5m, and show all the issues - golangci-lint -j 1 --color=never --timeout=10m run + # deadline of 10m, and show all the issues + golangci-lint -j 1 --color=never --timeout=10m run --verbose ./... if [[ $? != 0 ]]; then results_banner "Go Lint" 1