Skip to content

Commit

Permalink
✨ Upgrade scaffolds to use go 1.23 (#4446)
Browse files Browse the repository at this point in the history
Upgrade scaffolds to use go 1.23
  • Loading branch information
camilamacedo86 authored Dec 30, 2024
1 parent e25aec4 commit a8e72c3
Show file tree
Hide file tree
Showing 31 changed files with 47 additions and 30 deletions.
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'

- 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

0 comments on commit a8e72c3

Please sign in to comment.