From 3caf64aa02a7a76280ba9ce7fc0cb466e3aa0058 Mon Sep 17 00:00:00 2001 From: Ryan King Date: Mon, 13 Dec 2021 13:37:09 -0500 Subject: [PATCH] Update go version to 1.17 --- .github/workflows/testdata.yml | 2 +- .github/workflows/unit-tests.yml | 4 ++-- .../testdata/project/Dockerfile | 2 +- .../testdata/project/go.mod | 2 +- .../cronjob-tutorial/testdata/project/Dockerfile | 2 +- .../src/cronjob-tutorial/testdata/project/go.mod | 2 +- .../testdata/project/Dockerfile | 2 +- docs/book/utils/go.mod | 2 +- go.mod | 2 +- pkg/plugins/golang/go_version_test.go | 13 +++++++++++++ .../v3/scaffolds/internal/templates/dockerfile.go | 2 +- .../golang/v3/scaffolds/internal/templates/gomod.go | 2 +- testdata/project-v3-addon/Dockerfile | 2 +- testdata/project-v3-config/Dockerfile | 2 +- testdata/project-v3-multigroup/Dockerfile | 2 +- testdata/project-v3-multigroup/go.mod | 2 +- testdata/project-v3-v1beta1/Dockerfile | 2 +- testdata/project-v3/Dockerfile | 2 +- 18 files changed, 31 insertions(+), 18 deletions(-) diff --git a/.github/workflows/testdata.yml b/.github/workflows/testdata.yml index 5ec04e9a22f..fd0fbb05e1e 100644 --- a/.github/workflows/testdata.yml +++ b/.github/workflows/testdata.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2 with: - go-version: '1.16' + go-version: '1.17' - name: Remove pre-installed kustomize # This step is needed as the following one tries to remove # kustomize for each test but has no permission to do so diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index d8b9b836ba9..b59db892cf2 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -24,7 +24,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2 with: - go-version: '1.16' + go-version: '1.17' # This step is needed as the following one tries to remove # kustomize for each test but has no permission to do so - name: Remove pre-installed kustomize @@ -54,7 +54,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2 with: - go-version: '1.16' + go-version: '1.17' - name: Generate the coverage output run: make test-coverage - name: Send the coverage output diff --git a/docs/book/src/component-config-tutorial/testdata/project/Dockerfile b/docs/book/src/component-config-tutorial/testdata/project/Dockerfile index 4152680b742..456533d4c2d 100644 --- a/docs/book/src/component-config-tutorial/testdata/project/Dockerfile +++ b/docs/book/src/component-config-tutorial/testdata/project/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.16 as builder +FROM golang:1.17 as builder WORKDIR /workspace # Copy the Go Modules manifests diff --git a/docs/book/src/component-config-tutorial/testdata/project/go.mod b/docs/book/src/component-config-tutorial/testdata/project/go.mod index c7c37076aec..22797107923 100644 --- a/docs/book/src/component-config-tutorial/testdata/project/go.mod +++ b/docs/book/src/component-config-tutorial/testdata/project/go.mod @@ -1,6 +1,6 @@ module tutorial.kubebuilder.io/project -go 1.16 +go 1.17 require ( k8s.io/apimachinery v0.21.2 diff --git a/docs/book/src/cronjob-tutorial/testdata/project/Dockerfile b/docs/book/src/cronjob-tutorial/testdata/project/Dockerfile index 4152680b742..456533d4c2d 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/Dockerfile +++ b/docs/book/src/cronjob-tutorial/testdata/project/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.16 as builder +FROM golang:1.17 as builder WORKDIR /workspace # Copy the Go Modules manifests diff --git a/docs/book/src/cronjob-tutorial/testdata/project/go.mod b/docs/book/src/cronjob-tutorial/testdata/project/go.mod index 3714b94603a..9798a39fe20 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/go.mod +++ b/docs/book/src/cronjob-tutorial/testdata/project/go.mod @@ -1,6 +1,6 @@ module tutorial.kubebuilder.io/project -go 1.16 +go 1.17 require ( github.com/onsi/ginkgo v1.16.4 diff --git a/docs/book/src/multiversion-tutorial/testdata/project/Dockerfile b/docs/book/src/multiversion-tutorial/testdata/project/Dockerfile index 4152680b742..456533d4c2d 100644 --- a/docs/book/src/multiversion-tutorial/testdata/project/Dockerfile +++ b/docs/book/src/multiversion-tutorial/testdata/project/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.16 as builder +FROM golang:1.17 as builder WORKDIR /workspace # Copy the Go Modules manifests diff --git a/docs/book/utils/go.mod b/docs/book/utils/go.mod index 34b34552009..bc4ca16ac76 100644 --- a/docs/book/utils/go.mod +++ b/docs/book/utils/go.mod @@ -1,3 +1,3 @@ module sigs.k8s.io/kubebuilder/docs/book/utils -go 1.16 +go 1.17 diff --git a/go.mod b/go.mod index 26f3634a7bf..02da2636ff0 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module sigs.k8s.io/kubebuilder/v3 -go 1.16 +go 1.17 require ( github.com/cloudflare/cfssl v1.5.0 // for `kubebuilder alpha config-gen` diff --git a/pkg/plugins/golang/go_version_test.go b/pkg/plugins/golang/go_version_test.go index 40d5cf3f33b..dd52f800ba2 100644 --- a/pkg/plugins/golang/go_version_test.go +++ b/pkg/plugins/golang/go_version_test.go @@ -182,6 +182,19 @@ var _ = Describe("checkGoVersion", func() { Entry("for go 1.16.2", "go1.16.2"), Entry("for go 1.16.3", "go1.16.3"), Entry("for go 1.16.4", "go1.16.4"), + Entry("for go 1.16.5", "go1.16.5"), + Entry("for go 1.16.6", "go1.16.6"), + Entry("for go 1.16.7", "go1.16.7"), + Entry("for go 1.16.8", "go1.16.8"), + Entry("for go 1.16.9", "go1.16.9"), + Entry("for go 1.16.10", "go1.16.10"), + Entry("for go 1.16.11", "go1.16.11"), + Entry("for go 1.16.12", "go1.16.12"), + Entry("for go 1.17.1", "go1.17.1"), + Entry("for go 1.17.2", "go1.17.2"), + Entry("for go 1.17.3", "go1.17.3"), + Entry("for go 1.17.4", "go1.17.4"), + Entry("for go 1.17.5", "go1.17.5"), ) DescribeTable("should return an error for non-supported go versions", diff --git a/pkg/plugins/golang/v3/scaffolds/internal/templates/dockerfile.go b/pkg/plugins/golang/v3/scaffolds/internal/templates/dockerfile.go index b9bd3f60272..a072725ccac 100644 --- a/pkg/plugins/golang/v3/scaffolds/internal/templates/dockerfile.go +++ b/pkg/plugins/golang/v3/scaffolds/internal/templates/dockerfile.go @@ -39,7 +39,7 @@ func (f *Dockerfile) SetTemplateDefaults() error { } const dockerfileTemplate = `# Build the manager binary -FROM golang:1.16 as builder +FROM golang:1.17 as builder WORKDIR /workspace # Copy the Go Modules manifests diff --git a/pkg/plugins/golang/v3/scaffolds/internal/templates/gomod.go b/pkg/plugins/golang/v3/scaffolds/internal/templates/gomod.go index 69bd6d7ba55..f2cd7df7a35 100644 --- a/pkg/plugins/golang/v3/scaffolds/internal/templates/gomod.go +++ b/pkg/plugins/golang/v3/scaffolds/internal/templates/gomod.go @@ -46,7 +46,7 @@ func (f *GoMod) SetTemplateDefaults() error { const goModTemplate = ` module {{ .Repo }} -go 1.16 +go 1.17 require ( sigs.k8s.io/controller-runtime {{ .ControllerRuntimeVersion }} diff --git a/testdata/project-v3-addon/Dockerfile b/testdata/project-v3-addon/Dockerfile index 4152680b742..456533d4c2d 100644 --- a/testdata/project-v3-addon/Dockerfile +++ b/testdata/project-v3-addon/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.16 as builder +FROM golang:1.17 as builder WORKDIR /workspace # Copy the Go Modules manifests diff --git a/testdata/project-v3-config/Dockerfile b/testdata/project-v3-config/Dockerfile index 4152680b742..456533d4c2d 100644 --- a/testdata/project-v3-config/Dockerfile +++ b/testdata/project-v3-config/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.16 as builder +FROM golang:1.17 as builder WORKDIR /workspace # Copy the Go Modules manifests diff --git a/testdata/project-v3-multigroup/Dockerfile b/testdata/project-v3-multigroup/Dockerfile index 3ab32a14c7e..9a23dc6ee57 100644 --- a/testdata/project-v3-multigroup/Dockerfile +++ b/testdata/project-v3-multigroup/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.16 as builder +FROM golang:1.17 as builder WORKDIR /workspace # Copy the Go Modules manifests diff --git a/testdata/project-v3-multigroup/go.mod b/testdata/project-v3-multigroup/go.mod index 17ff4568a9c..dbe65bf38c1 100644 --- a/testdata/project-v3-multigroup/go.mod +++ b/testdata/project-v3-multigroup/go.mod @@ -1,6 +1,6 @@ module sigs.k8s.io/kubebuilder/testdata/project-v3-multigroup -go 1.16 +go 1.17 require ( github.com/onsi/ginkgo v1.16.4 diff --git a/testdata/project-v3-v1beta1/Dockerfile b/testdata/project-v3-v1beta1/Dockerfile index 4152680b742..456533d4c2d 100644 --- a/testdata/project-v3-v1beta1/Dockerfile +++ b/testdata/project-v3-v1beta1/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.16 as builder +FROM golang:1.17 as builder WORKDIR /workspace # Copy the Go Modules manifests diff --git a/testdata/project-v3/Dockerfile b/testdata/project-v3/Dockerfile index 4152680b742..456533d4c2d 100644 --- a/testdata/project-v3/Dockerfile +++ b/testdata/project-v3/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.16 as builder +FROM golang:1.17 as builder WORKDIR /workspace # Copy the Go Modules manifests