From b4b8e45d21d34ddd017c81e9e0cc9b3b8d3a71d4 Mon Sep 17 00:00:00 2001 From: cpanato Date: Mon, 30 Dec 2024 16:59:24 +0100 Subject: [PATCH 1/3] add GO_VERSION_TOOLING to be able to build the release tooling with another go version Signed-off-by: cpanato --- images/releng/k8s-ci-builder/Dockerfile | 9 +++-- images/releng/k8s-ci-builder/Makefile | 2 + images/releng/k8s-ci-builder/cloudbuild.yaml | 40 ++++++++++---------- images/releng/k8s-ci-builder/variants.yaml | 6 +++ 4 files changed, 34 insertions(+), 23 deletions(-) diff --git a/images/releng/k8s-ci-builder/Dockerfile b/images/releng/k8s-ci-builder/Dockerfile index ec851ea559c..f06552f409a 100644 --- a/images/releng/k8s-ci-builder/Dockerfile +++ b/images/releng/k8s-ci-builder/Dockerfile @@ -15,9 +15,9 @@ ARG GO_VERSION ARG OS_CODENAME -# The Golang version for the builder image should always be explicitly set to -# the Golang version of the kubernetes/kubernetes active development branch -FROM golang:${GO_VERSION}-${OS_CODENAME} AS builder +# The Release Tooling can be compiled with a different version of Go than the +# the Go version used in the kubernetes/kubernetes active development branch. +FROM golang:${GO_VERSION_TOOLING}-${OS_CODENAME} AS builder WORKDIR /go/src/k8s.io/release @@ -33,7 +33,8 @@ FROM debian:${OS_CODENAME} # arg that specifies the image name (for debugging) ARG IMAGE_ARG -# arg that specifies the go version to install +# The Golang version for the builder image should always be explicitly set to +# the Golang version of the kubernetes/kubernetes active development branch ARG GO_VERSION # arg that specifies docker-buildx version to install diff --git a/images/releng/k8s-ci-builder/Makefile b/images/releng/k8s-ci-builder/Makefile index 83aa1a43920..10ed719bf51 100644 --- a/images/releng/k8s-ci-builder/Makefile +++ b/images/releng/k8s-ci-builder/Makefile @@ -25,10 +25,12 @@ TAG ?= $(shell git describe --tags --always --dirty) # Build args GO_VERSION ?= 1.23.3 +GO_VERSION_TOOLING ?= 1.23.4 OS_CODENAME ?= bullseye IMAGE_ARG ?= $(IMAGE):$(TAG)-$(CONFIG) BUILD_ARGS = --build-arg=GO_VERSION=$(GO_VERSION) \ + --build-arg=GO_VERSION_TOOLING=$(GO_VERSION_TOOLING) \ --build-arg=OS_CODENAME=$(OS_CODENAME) \ --build-arg=IMAGE_ARG=$(IMAGE_ARG) diff --git a/images/releng/k8s-ci-builder/cloudbuild.yaml b/images/releng/k8s-ci-builder/cloudbuild.yaml index 821b71bae46..9c7769187f5 100644 --- a/images/releng/k8s-ci-builder/cloudbuild.yaml +++ b/images/releng/k8s-ci-builder/cloudbuild.yaml @@ -15,20 +15,20 @@ steps: entrypoint: 'bash' dir: ./images/releng/k8s-ci-builder env: - - DOCKER_CLI_EXPERIMENTAL=enabled - - REGISTRY=$_REGISTRY - - IMAGE_ARG='$_REGISTRY/k8s-ci-builder:${_GIT_TAG}-${_CONFIG}' - - HOME=/root - - TAG=${_GIT_TAG} - - PULL_BASE_REF=${_PULL_BASE_REF} - - CONFIG=${_CONFIG} - - GO_VERSION=${_GO_VERSION} - - OS_CODENAME=${_OS_CODENAME} + - DOCKER_CLI_EXPERIMENTAL=enabled + - REGISTRY=$_REGISTRY + - IMAGE_ARG='$_REGISTRY/k8s-ci-builder:${_GIT_TAG}-${_CONFIG}' + - HOME=/root + - TAG=${_GIT_TAG} + - PULL_BASE_REF=${_PULL_BASE_REF} + - CONFIG=${_CONFIG} + - GO_VERSION=${_GO_VERSION} + - OS_CODENAME=${_OS_CODENAME} args: - - '-c' - - | - gcloud auth configure-docker \ - && make push + - '-c' + - | + gcloud auth configure-docker \ + && make push substitutions: # _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and @@ -37,16 +37,18 @@ substitutions: _PULL_BASE_REF: 'dev' _CONFIG: 'config' _GO_VERSION: '0.0.0' + _GO_VERSION_TOOLING: '0.0.0' _OS_CODENAME: 'codename' _REGISTRY: 'fake.repository/registry-name' tags: -- 'k8s-ci-builder' -- ${_GIT_TAG} -- ${_PULL_BASE_REF} -- ${_CONFIG} -- ${_GO_VERSION} -- ${_OS_CODENAME} + - 'k8s-ci-builder' + - ${_GIT_TAG} + - ${_PULL_BASE_REF} + - ${_CONFIG} + - ${_GO_VERSION} + - ${_GO_VERSION_TOOLING} + - ${_OS_CODENAME} images: - 'gcr.io/$PROJECT_ID/k8s-ci-builder:${_CONFIG}' diff --git a/images/releng/k8s-ci-builder/variants.yaml b/images/releng/k8s-ci-builder/variants.yaml index df5426d976d..9d9c1726445 100644 --- a/images/releng/k8s-ci-builder/variants.yaml +++ b/images/releng/k8s-ci-builder/variants.yaml @@ -2,24 +2,30 @@ variants: default: CONFIG: default GO_VERSION: '1.22.9' + GO_VERSION_TOOLING: '1.23.4' OS_CODENAME: 'bullseye' next: CONFIG: next GO_VERSION: '1.23.3' + GO_VERSION_TOOLING: '1.23.4' OS_CODENAME: 'bookworm' '1.32': CONFIG: '1.32' GO_VERSION: '1.23.3' + GO_VERSION_TOOLING: '1.23.4' OS_CODENAME: 'bullseye' '1.31': CONFIG: '1.31' GO_VERSION: '1.22.9' + GO_VERSION_TOOLING: '1.23.4' OS_CODENAME: 'bullseye' '1.30': CONFIG: '1.30' GO_VERSION: '1.22.9' + GO_VERSION_TOOLING: '1.23.4' OS_CODENAME: 'bullseye' '1.29': CONFIG: '1.29' GO_VERSION: '1.22.9' + GO_VERSION_TOOLING: '1.23.4' OS_CODENAME: 'bullseye' From 636e9dbc622c4d1e318c611396ec648bd7bafb98 Mon Sep 17 00:00:00 2001 From: cpanato Date: Mon, 30 Dec 2024 17:06:40 +0100 Subject: [PATCH 2/3] lock dependencies Signed-off-by: cpanato --- dependencies.yaml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/dependencies.yaml b/dependencies.yaml index ba82acd5b97..5c8a5ac743e 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -391,6 +391,47 @@ dependencies: - path: images/releng/k8s-ci-builder/variants.yaml match: \d+.\d+(alpha|beta|rc)?\.?(\d+)? + # k8s-ci-builder + - name: "golang: releng tooling for k8s-ci-builder (master)" + version: 1.23.4 + refPaths: + - path: images/releng/k8s-ci-builder/Makefile + match: GO_VERSION_TOOLING\ \?=\ \d+.\d+(alpha|beta|rc)?\.?(\d+)? + - path: images/releng/k8s-ci-builder/variants.yaml + match: "GO_VERSION_TOOLING: '\\d+.\\d+(alpha|beta|rc)?\\.?(\\d+)?'" + + - name: "golang: releng tooling for k8s-ci-builder (previous release branches: 1.32)" + version: 1.23.4 + refPaths: + - path: images/releng/k8s-ci-builder/Makefile + match: GO_VERSION_TOOLING\ \?=\ \d+.\d+(alpha|beta|rc)?\.?(\d+)? + - path: images/releng/k8s-ci-builder/variants.yaml + match: "GO_VERSION_TOOLING: '\\d+.\\d+(alpha|beta|rc)?\\.?(\\d+)?'" + + - name: "golang: releng tooling for k8s-ci-builder (previous release branches: 1.31)" + version: 1.23.4 + refPaths: + - path: images/releng/k8s-ci-builder/Makefile + match: GO_VERSION_TOOLING\ \?=\ \d+.\d+(alpha|beta|rc)?\.?(\d+)? + - path: images/releng/k8s-ci-builder/variants.yaml + match: "GO_VERSION_TOOLING: '\\d+.\\d+(alpha|beta|rc)?\\.?(\\d+)?'" + + - name: "golang: releng tooling for k8s-ci-builder (previous release branches: 1.30)" + version: 1.23.4 + refPaths: + - path: images/releng/k8s-ci-builder/Makefile + match: GO_VERSION_TOOLING\ \?=\ \d+.\d+(alpha|beta|rc)?\.?(\d+)? + - path: images/releng/k8s-ci-builder/variants.yaml + match: "GO_VERSION_TOOLING: '\\d+.\\d+(alpha|beta|rc)?\\.?(\\d+)?'" + + - name: "golang: releng tooling for k8s-ci-builder (previous release branches: 1.29)" + version: 1.23.4 + refPaths: + - path: images/releng/k8s-ci-builder/Makefile + match: GO_VERSION_TOOLING\ \?=\ \d+.\d+(alpha|beta|rc)?\.?(\d+)? + - path: images/releng/k8s-ci-builder/variants.yaml + match: "GO_VERSION_TOOLING: '\\d+.\\d+(alpha|beta|rc)?\\.?(\\d+)?'" + # golangci-lint-version - name: "golangci-lint" version: v1.62 From 987773fba801965b1d02a7654e6ea41a49cda834 Mon Sep 17 00:00:00 2001 From: cpanato Date: Mon, 30 Dec 2024 17:08:37 +0100 Subject: [PATCH 3/3] fix missing variable Signed-off-by: cpanato --- images/releng/k8s-ci-builder/Dockerfile | 2 +- images/releng/k8s-ci-builder/cloudbuild.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/images/releng/k8s-ci-builder/Dockerfile b/images/releng/k8s-ci-builder/Dockerfile index f06552f409a..c9fb8d001c9 100644 --- a/images/releng/k8s-ci-builder/Dockerfile +++ b/images/releng/k8s-ci-builder/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG GO_VERSION +ARG GO_VERSION_TOOLING ARG OS_CODENAME # The Release Tooling can be compiled with a different version of Go than the diff --git a/images/releng/k8s-ci-builder/cloudbuild.yaml b/images/releng/k8s-ci-builder/cloudbuild.yaml index 9c7769187f5..44aebe2acf0 100644 --- a/images/releng/k8s-ci-builder/cloudbuild.yaml +++ b/images/releng/k8s-ci-builder/cloudbuild.yaml @@ -23,6 +23,7 @@ steps: - PULL_BASE_REF=${_PULL_BASE_REF} - CONFIG=${_CONFIG} - GO_VERSION=${_GO_VERSION} + - GO_VERSION_TOOLING=${_GO_VERSION_TOOLING} - OS_CODENAME=${_OS_CODENAME} args: - '-c'