diff --git a/Makefile.version b/Makefile.version index 9ea414d6..c99c7b30 100644 --- a/Makefile.version +++ b/Makefile.version @@ -1,2 +1,2 @@ -GO_VERSION := 1.18.0 -GINKGO_VERSION := 2.1.3 \ No newline at end of file +GO_VERSION := 1.17.8 +GINKGO_VERSION := 2.1.3 diff --git a/cmd/controller/main.go b/cmd/controller/main.go index 8f96527b..cfba85b8 100644 --- a/cmd/controller/main.go +++ b/cmd/controller/main.go @@ -1,7 +1,7 @@ // Ensure build fails on versions of Go that are not supported // This build tag should be kept in sync with the version specified in go.mod. -//go:build go1.18 -// +build go1.18 +//go:build go1.17 +// +build go1.17 // Copyright 2022 Authors of welan // SPDX-License-Identifier: Apache-2.0 diff --git a/go.mod b/go.mod index b08d4e24..4d7b4266 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/weizhoublue/github-action-test -go 1.17.8 +go 1.17 require ( github.com/gogo/protobuf v1.3.2 diff --git a/images/Makefile b/images/Makefile index a6c28cee..5e00c991 100644 --- a/images/Makefile +++ b/images/Makefile @@ -32,4 +32,8 @@ baseimage: --platform=$(PLATFORM) --output $(OUTPUT) \ -f $(ROOT_DIR)/images/controllerimage/Dockerfile $(ROOT_DIR)/ +.PHONY: update-golang-image +update-golang-image: + GO_VERSION=$(GO_VERSION) scripts/update-golang-image.sh + diff --git a/images/baseimage/Dockerfile b/images/baseimage/Dockerfile index 30e57ae5..b1abb771 100644 --- a/images/baseimage/Dockerfile +++ b/images/baseimage/Dockerfile @@ -1,7 +1,7 @@ # on the local directory, ,run: docker buildx build -t testbase:latest --platform=linux/arm64,linux/amd64 --output type=docker . -ARG GOLANG_IMAGE=docker.io/library/golang:1.18.0@sha256:03baa0921adf5fb547f48df8b16137de82b5ccc34986c22a967055379369f614 +ARG GOLANG_IMAGE=docker.io/library/golang:1.17.8@sha256:f675106e44f205a7284e15cd75c41b241329f3c03ac30b0ba07b14a6ea7c99d9 ARG UBUNTU_IMAGE=docker.io/library/ubuntu:20.04@sha256:8ae9bafbb64f63a50caab98fd3a5e37b3eb837a3e0780b78e5218e63193961f9 #========= build gops =============== diff --git a/images/controllerimage/Dockerfile b/images/controllerimage/Dockerfile index 9bc94c9c..b6770ee2 100644 --- a/images/controllerimage/Dockerfile +++ b/images/controllerimage/Dockerfile @@ -5,7 +5,7 @@ # docker buildx build -t release:latest --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT_TIME=${GIT_COMMIT_TIME} --build-arg GIT_COMMIT_VERSION=${GIT_COMMIT_VERSION} --platform=linux/amd64,linux/arm64 --output type=docker -f ./images/controllerimage/Dockerfile . ARG BASE_IMAGE=ghcr.io/weizhoublue/github-action-test/baseimage:8700413ad57ead614f734b1311cf83231941713c@sha256:118ffa12150f4e6572a694250e7d7ce6fd6a555d28231f751c0089e2aa6f9f86 -ARG GOLANG_IMAGE=docker.io/library/golang:1.18.0@sha256:03baa0921adf5fb547f48df8b16137de82b5ccc34986c22a967055379369f614 +ARG GOLANG_IMAGE=docker.io/library/golang:1.17.8@sha256:f675106e44f205a7284e15cd75c41b241329f3c03ac30b0ba07b14a6ea7c99d9 # TARGETARCH is an automatic platform ARG enabled by Docker BuildKit. # like amd64 arm64 diff --git a/images/scripts/update-golang-image.sh b/images/scripts/update-golang-image.sh index 3736f64d..3530707a 100755 --- a/images/scripts/update-golang-image.sh +++ b/images/scripts/update-golang-image.sh @@ -40,6 +40,4 @@ used_by=($(git grep -l GOLANG_IMAGE= images/*/Dockerfile)) for i in "${used_by[@]}" ; do # golang images with image digest sed "s|GOLANG_IMAGE=docker\.io/library/golang:[0-9][0-9]*\.[0-9][0-9]*\(\.[0-9][0-9]*\)\?@.*|GOLANG_IMAGE=${image}@${image_digest}|" "${i}" > "${i}.sedtmp" && mv "${i}.sedtmp" "${i}" - #sed "s|GOLANG_IMAGE=docker\.io/library/golang:[0-9][0-9]*\.[0-9][0-9]*\(\.[0-9][0-9]*\)\?@.*|GOLANG_IMAGE=${image}@${image_digest}|" "${i}" > "${i}.sedtmp" - done