Skip to content

Commit

Permalink
✨ add support to go 1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
camilamacedo86 committed Jun 7, 2022
1 parent bb28de3 commit 40d534d
Show file tree
Hide file tree
Showing 26 changed files with 29 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/apidiff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "1.17"
go-version: "1.18"
- name: Execute go-apidiff
uses: joelanford/go-apidiff@v0.2.0
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@v2
with:
go-version: '1.17'
go-version: '1.18'
- 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
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "1.17"
go-version: "1.18"
# 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 Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "1.17"
go-version: "1.18"
- name: Generate the coverage output
run: make test-coverage
- name: Send the coverage output
Expand Down
2 changes: 1 addition & 1 deletion build/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ builds:
- darwin_amd64
- darwin_arm64
env:
- KUBERNETES_VERSION=1.23.5
- KUBERNETES_VERSION=1.24.1
- CGO_ENABLED=0

# Only binaries of the form "kubebuilder_${goos}_${goarch}" will be released.
Expand Down
2 changes: 1 addition & 1 deletion build/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ steps:
git checkout $${BRANCH_NAME}
git branch --set-upstream-to=origin/$${BRANCH_NAME}
git tag -d ${TAG_NAME}
- name: "goreleaser/goreleaser:v1.8.3"
- name: "goreleaser/goreleaser:v1.9.2"
entrypoint: "bash"
args: ["build/build_kubebuilder.sh"]
secretEnv: ["GITHUB_TOKEN"]
Expand Down
2 changes: 1 addition & 1 deletion build/cloudbuild_local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Release tar will be in ./cloudbuild

steps:
- name: "goreleaser/goreleaser:v1.8.3"
- name: "goreleaser/goreleaser:v1.9.2"
entrypoint: "bash"
env: ["SNAPSHOT=1"]
args: ["build/build_kubebuilder.sh"]
2 changes: 1 addition & 1 deletion build/cloudbuild_snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Release tar will be in ./cloudbuild

steps:
- name: "goreleaser/goreleaser:v1.8.3"
- name: "goreleaser/goreleaser:v1.9.2"
entrypoint: "bash"
env: ["SNAPSHOT=1"]
args: ["build/build_kubebuilder.sh"]
Expand Down
3 changes: 2 additions & 1 deletion docs/book/src/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ This Quick Start guide will cover:

- [go](https://golang.org/dl/) version v1.15+ (kubebuilder v3.0 < v3.1).
- [go](https://golang.org/dl/) version v1.16+ (kubebuilder v3.1 < v3.3).
- [go](https://golang.org/dl/) version v1.17+ < v1.18 (kubebuilder v3.3+).
- [go](https://golang.org/dl/) version v1.17+ < v1.18 (kubebuilder v3.4.1).
- [go](https://golang.org/dl/) version v1.17.9+ (kubebuilder v3.5+).
- [docker](https://docs.docker.com/install/) version 17.03+.
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) version v1.11.3+.
- Access to a Kubernetes v1.11.3+ cluster.
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/alpha/config-gen/testdata/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module config-gen/testdata

go 1.17
go 1.18

require (
k8s.io/apimachinery v0.23.5
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 @@ -195,6 +195,7 @@ var _ = Describe("checkGoVersion", func() {
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"),
Entry("for go 1.18.1", "go1.18.1"),
)

DescribeTable("should return an error for non-supported go versions",
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/golang/v3/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (

// Variables and function to check Go version requirements.
var (
goVerMin = golang.MustParse("go1.17")
goVerMin = golang.MustParse("go1.17.9")
goVerMax = golang.MustParse("go2.0alpha1")
)

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.17 as builder
FROM golang:1.18 as builder
WORKDIR /workspace
# Copy the Go Modules manifests
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.17
go 1.18
require (
sigs.k8s.io/controller-runtime {{ .ControllerRuntimeVersion }}
Expand Down
3 changes: 2 additions & 1 deletion test/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function convert_to_tools_ver {
"1.20"|"1.21") echo "1.19.2";;
"1.22") echo "1.22.1";;
"1.23") echo "1.23.3";;
"1.24") echo "1.24.1";;
*)
echo "k8s version $k8s_ver not supported"
exit 1
Expand All @@ -45,7 +46,7 @@ if [ -n "$TRACE" ]; then
set -x
fi

export KIND_K8S_VERSION="${KIND_K8S_VERSION:-"v1.23.3"}"
export KIND_K8S_VERSION="${KIND_K8S_VERSION:-"v1.24.1"}"
tools_k8s_version=$(convert_to_tools_ver "${KIND_K8S_VERSION#v*}")
kind_version=0.11.1
goarch=amd64
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v3-addon/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.17 as builder
FROM golang:1.18 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v3-addon/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/kubebuilder/testdata/project-v3-addon

go 1.17
go 1.18

require (
github.com/go-logr/logr v1.2.0
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v3-config/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.17 as builder
FROM golang:1.18 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v3-config/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/kubebuilder/testdata/project-v3-config

go 1.17
go 1.18

require (
github.com/onsi/ginkgo v1.16.5
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v3-multigroup/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.17 as builder
FROM golang:1.18 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v3-multigroup/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/kubebuilder/testdata/project-v3-multigroup

go 1.17
go 1.18

require (
github.com/onsi/ginkgo v1.16.5
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v3-v1beta1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.17 as builder
FROM golang:1.18 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v3-v1beta1/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/kubebuilder/testdata/project-v3-v1beta1

go 1.17
go 1.18

require (
github.com/onsi/ginkgo v1.16.4
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v3-with-kustomize-v2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.17 as builder
FROM golang:1.18 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v3-with-kustomize-v2/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/kubebuilder/testdata/project-v3-with-kustomize-v2

go 1.17
go 1.18

require (
github.com/onsi/ginkgo v1.16.5
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v3/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.17 as builder
FROM golang:1.18 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v3/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/kubebuilder/testdata/project-v3

go 1.17
go 1.18

require (
github.com/onsi/ginkgo v1.16.5
Expand Down

0 comments on commit 40d534d

Please sign in to comment.