Upgrade Go version to v1.20 (#583)

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
This commit is contained in:
Yuki Iwai 2023-08-08 03:01:55 +09:00 committed by GitHub
parent 18250f5e69
commit 11b38050c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 9 deletions

View File

@ -18,6 +18,6 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.50.1
args: --timeout=5m --go=1.19
version: v1.53.3
args: --timeout=5m --go=1.20
only-new-issues: true

View File

@ -24,7 +24,7 @@ git clone https://github.com/${GITHUB_USER}/mpi-operator.git
## Install Dependencies
We use Go v1.19+ for development and use [Go Modules](https://blog.golang.org/using-go-modules) to download and install the dependencies.
We use Go v1.20+ for development and use [Go Modules](https://blog.golang.org/using-go-modules) to download and install the dependencies.
## Run tests

View File

@ -1,4 +1,6 @@
FROM golang:1.19 AS build
# TODO: Once the gcr.io/distroless/base-debian12 is released, we can use `golang:1.20` as a base image.
# REF: https://github.com/GoogleContainerTools/distroless/issues/1342
FROM golang:1.20-bullseye AS build
# Set mpi-operator version
# Defaults to v2
@ -10,7 +12,7 @@ WORKDIR /go/src/github.com/kubeflow/mpi-operator
RUN make RELEASE_VERSION=${RELEASE_VERSION} mpi-operator.$VERSION
RUN ln -s mpi-operator.${VERSION} _output/cmd/bin/mpi-operator
FROM gcr.io/distroless/base-debian10:latest
FROM gcr.io/distroless/base-debian11:latest
ENV CONTROLLER_VERSION=$VERSION
COPY --from=build /go/src/github.com/kubeflow/mpi-operator/_output/cmd/bin/* /opt/

View File

@ -117,11 +117,11 @@ test_images:
.PHONY: tidy
tidy:
go mod tidy -go 1.19
go mod tidy -go 1.20
.PHONY: lint
lint: bin/golangci-lint ## Run golangci-lint linter
$(GOLANGCI_LINT) run --new-from-rev=origin/master --go 1.19
$(GOLANGCI_LINT) run --new-from-rev=origin/master --go 1.20
# Generate deploy/v2beta1/mpi-operator.yaml
manifest: kustomize crd
@ -138,7 +138,7 @@ bin:
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
.PHONY: bin/golangci-lint
bin/golangci-lint: bin
@GOBIN=$(PROJECT_DIR)/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
@GOBIN=$(PROJECT_DIR)/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3
ENVTEST = $(shell pwd)/bin/setup-envtest
.PHONY: envtest

2
go.mod
View File

@ -1,6 +1,6 @@
module github.com/kubeflow/mpi-operator
go 1.19
go 1.20
require (
github.com/google/go-cmp v0.5.9