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

✨ (API and go/v4): Upgrade go version to 1.20 #3355

Merged
merged 1 commit into from
May 1, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/apidiff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.19"
go-version: '~1.20'
- name: Execute go-apidiff
uses: joelanford/go-apidiff@v0.6.0
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: '~1.20'
- name: Clone the code
uses: actions/checkout@v3
- name: Run linter
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '~1.19'
go-version: '~1.20'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version: '~1.20'
- 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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.19"
go-version: '~1.20'
# 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.19 as builder
FROM golang:1.20 as builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module tutorial.kubebuilder.io/project

go 1.19
go 1.20

require (
k8s.io/apimachinery v0.26.1
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/kubebuilder/v3

go 1.19
go 1.20

require (
github.com/gobuffalo/flect v1.0.2
Expand Down
1 change: 1 addition & 0 deletions pkg/plugins/golang/go_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ var _ = Describe("checkGoVersion", func() {
Entry("for go 1.18.1", "go1.18.1"),
Entry("for go.1.19", "go1.19"),
Entry("for go.1.19.1", "go1.19.1"),
Entry("for go.1.20", "go1.20"),
)

DescribeTable("should return an error for non-supported go versions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (f *Dockerfile) SetTemplateDefaults() error {
}

const dockerfileTemplate = `# Build the manager binary
FROM golang:1.19 as builder
FROM golang:1.20 as builder
ARG TARGETOS
ARG TARGETARCH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (f *GoMod) SetTemplateDefaults() error {
const goModTemplate = `
module {{ .Repo }}
go 1.19
go 1.20
require (
sigs.k8s.io/controller-runtime {{ .ControllerRuntimeVersion }}
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-config/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.19 as builder
FROM golang:1.20 as builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-config/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/kubebuilder/testdata/project-v4-config

go 1.19
go 1.20

require (
github.com/onsi/ginkgo/v2 v2.6.0
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-declarative-v1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.19 as builder
FROM golang:1.20 as builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-declarative-v1/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/kubebuilder/testdata/project-v4-declarative-v1

go 1.19
go 1.20

require (
github.com/go-logr/logr v1.2.3
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-multigroup/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.19 as builder
FROM golang:1.20 as builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-multigroup/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup

go 1.19
go 1.20

require (
github.com/onsi/ginkgo/v2 v2.6.0
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-with-deploy-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.19 as builder
FROM golang:1.20 as builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-with-deploy-image/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/kubebuilder/testdata/project-v4-with-deploy-image

go 1.19
go 1.20

require (
github.com/onsi/ginkgo/v2 v2.6.0
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-with-grafana/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.19 as builder
FROM golang:1.20 as builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-with-grafana/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/kubebuilder/testdata/project-v4-with-grafana

go 1.19
go 1.20

require (
k8s.io/apimachinery v0.26.1
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.19 as builder
FROM golang:1.20 as builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/kubebuilder/testdata/project-v4

go 1.19
go 1.20

require (
github.com/onsi/ginkgo/v2 v2.6.0
Expand Down