Skip to content

Commit

Permalink
add GO_VERSION_TOOLING to be able to build the release tooling with a…
Browse files Browse the repository at this point in the history
…nother go version

Signed-off-by: cpanato <[email protected]>
  • Loading branch information
cpanato committed Dec 30, 2024
1 parent b11e233 commit b4b8e45
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 23 deletions.
9 changes: 5 additions & 4 deletions images/releng/k8s-ci-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions images/releng/k8s-ci-builder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
40 changes: 21 additions & 19 deletions images/releng/k8s-ci-builder/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}'
Expand Down
6 changes: 6 additions & 0 deletions images/releng/k8s-ci-builder/variants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit b4b8e45

Please sign in to comment.