Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add GO_VERSION_TOOLING to be able to build the release tooling with another go version #3874

Merged
merged 3 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions images/releng/k8s-ci-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
# 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 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
41 changes: 22 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,21 @@ 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}
- GO_VERSION_TOOLING=${_GO_VERSION_TOOLING}
- 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 +38,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'
Loading