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

✨ Upgrade scaffolds to use go 1.23 #4446

Merged
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/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.23'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be better to use go-version-file: go.mod?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you like to push a PR with this change?
Yes, that it would be better if work out in this case

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, can work on that next week


- name: Build and install Kubebuilder CLI
run: make install
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Kubebuilder DevContainer",
"image": "golang:1.22",
"image": "golang:1.23",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/git:1": {}
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/cronjob-tutorial/testdata/project/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.22 AS builder
FROM golang:1.23 AS builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/cronjob-tutorial/testdata/project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Getting Started

### Prerequisites
- go version v1.22.0+
- go version v1.23.0+
- docker version 17.03+.
- kubectl version v1.11.3+.
- Access to a Kubernetes v1.11.3+ cluster.
Expand Down
4 changes: 3 additions & 1 deletion docs/book/src/cronjob-tutorial/testdata/project/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module tutorial.kubebuilder.io/project

go 1.22.0
go 1.23.0

godebug default=go1.23

require (
github.com/onsi/ginkgo/v2 v2.19.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Kubebuilder DevContainer",
"image": "golang:1.22",
"image": "golang:1.23",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/git:1": {}
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/getting-started/testdata/project/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.22 AS builder
FROM golang:1.23 AS builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/getting-started/testdata/project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Getting Started

### Prerequisites
- go version v1.22.0+
- go version v1.23.0+
- docker version 17.03+.
- kubectl version v1.11.3+.
- Access to a Kubernetes v1.11.3+ cluster.
Expand Down
4 changes: 3 additions & 1 deletion docs/book/src/getting-started/testdata/project/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module example.com/memcached

go 1.22.0
go 1.23.0

godebug default=go1.23

require (
github.com/onsi/ginkgo/v2 v2.19.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Kubebuilder DevContainer",
"image": "golang:1.22",
"image": "golang:1.23",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/git:1": {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.22 AS builder
FROM golang:1.23 AS builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Getting Started

### Prerequisites
- go version v1.22.0+
- go version v1.23.0+
- docker version 17.03+.
- kubectl version v1.11.3+.
- Access to a Kubernetes v1.11.3+ cluster.
Expand Down
4 changes: 3 additions & 1 deletion docs/book/src/multiversion-tutorial/testdata/project/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module tutorial.kubebuilder.io/project

go 1.22.0
go 1.23.0

godebug default=go1.23

require (
github.com/onsi/ginkgo/v2 v2.19.0
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module sigs.k8s.io/kubebuilder/v4

go 1.22.3
go 1.23.0

godebug default=go1.23

require (
github.com/gobuffalo/flect v1.0.3
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 @@ -200,6 +200,7 @@ var _ = Describe("checkGoVersion", func() {
Entry("for go.1.20", "go1.20"),
Entry("for go.1.21", "go1.21"),
Entry("for go.1.22", "go1.22"),
Entry("for go.1.23", "go1.23"),
)

DescribeTable("should return an error for non-supported go versions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

const devContainerTemplate = `{
"name": "Kubebuilder DevContainer",
"image": "golang:1.22",
"image": "golang:1.23",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/git:1": {}
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.22 AS builder
FROM golang:1.23 AS builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
4 changes: 3 additions & 1 deletion pkg/plugins/golang/v4/scaffolds/internal/templates/gomod.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ func (f *GoMod) SetTemplateDefaults() error {

const goModTemplate = `module {{ .Repo }}

go 1.22.0
go 1.23.0

godebug default=go1.23

require (
sigs.k8s.io/controller-runtime {{ .ControllerRuntimeVersion }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const readmeFileTemplate = `# {{ .ProjectName }}
## Getting Started

### Prerequisites
- go version v1.22.0+
- go version v1.23.0+
- docker version 17.03+.
- kubectl version v1.11.3+.
- Access to a Kubernetes v1.11.3+ cluster.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Kubebuilder DevContainer",
"image": "golang:1.22",
"image": "golang:1.23",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/git:1": {}
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.22 AS builder
FROM golang:1.23 AS builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-multigroup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Getting Started

### Prerequisites
- go version v1.22.0+
- go version v1.23.0+
- docker version 17.03+.
- kubectl version v1.11.3+.
- Access to a Kubernetes v1.11.3+ cluster.
Expand Down
4 changes: 3 additions & 1 deletion testdata/project-v4-multigroup/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup

go 1.22.0
go 1.23.0

godebug default=go1.23

require (
github.com/cert-manager/cert-manager v1.16.2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Kubebuilder DevContainer",
"image": "golang:1.22",
"image": "golang:1.23",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/git:1": {}
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-with-plugins/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.22 AS builder
FROM golang:1.23 AS builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-with-plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Getting Started

### Prerequisites
- go version v1.22.0+
- go version v1.23.0+
- docker version 17.03+.
- kubectl version v1.11.3+.
- Access to a Kubernetes v1.11.3+ cluster.
Expand Down
4 changes: 3 additions & 1 deletion testdata/project-v4-with-plugins/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module sigs.k8s.io/kubebuilder/testdata/project-v4-with-plugins

go 1.22.0
go 1.23.0

godebug default=go1.23

require (
github.com/onsi/ginkgo/v2 v2.19.0
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Kubebuilder DevContainer",
"image": "golang:1.22",
"image": "golang:1.23",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/git: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.22 AS builder
FROM golang:1.23 AS builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Getting Started

### Prerequisites
- go version v1.22.0+
- go version v1.23.0+
- docker version 17.03+.
- kubectl version v1.11.3+.
- Access to a Kubernetes v1.11.3+ cluster.
Expand Down
4 changes: 3 additions & 1 deletion testdata/project-v4/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module sigs.k8s.io/kubebuilder/testdata/project-v4

go 1.22.0
go 1.23.0

godebug default=go1.23

require (
github.com/cert-manager/cert-manager v1.16.2
Expand Down
Loading