From 1ae7c0b4fe96916c83a829e6dee5a01ddb6d4289 Mon Sep 17 00:00:00 2001 From: yyy1000 <992364620@qq.com> Date: Tue, 2 May 2023 11:59:41 +0800 Subject: [PATCH 1/2] feat: update k8s version to 1.27.1 --- build/.goreleaser.yml | 2 +- .../src/component-config-tutorial/testdata/project/Makefile | 2 +- docs/book/src/cronjob-tutorial/testdata/project/Makefile | 2 +- docs/book/src/multiversion-tutorial/testdata/project/Makefile | 2 +- pkg/plugin/util/testdata/exampleFile.txt | 2 +- pkg/plugins/golang/v3/commons.go | 2 +- pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go | 2 +- pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go | 2 +- test/common.sh | 3 ++- testdata/project-v3/Makefile | 2 +- testdata/project-v4-config/Makefile | 2 +- testdata/project-v4-declarative-v1/Makefile | 2 +- testdata/project-v4-multigroup/Makefile | 2 +- testdata/project-v4-with-deploy-image/Makefile | 2 +- testdata/project-v4-with-grafana/Makefile | 2 +- testdata/project-v4/Makefile | 2 +- 16 files changed, 17 insertions(+), 16 deletions(-) diff --git a/build/.goreleaser.yml b/build/.goreleaser.yml index 6cc3904d9d..71f948e7e5 100644 --- a/build/.goreleaser.yml +++ b/build/.goreleaser.yml @@ -44,7 +44,7 @@ builds: - darwin_amd64 - darwin_arm64 env: - - KUBERNETES_VERSION=1.26.1 + - KUBERNETES_VERSION=1.27.1 - CGO_ENABLED=0 # Only binaries of the form "kubebuilder_${goos}_${goarch}" will be released. diff --git a/docs/book/src/component-config-tutorial/testdata/project/Makefile b/docs/book/src/component-config-tutorial/testdata/project/Makefile index 6d6fe66b82..fc46ce845f 100644 --- a/docs/book/src/component-config-tutorial/testdata/project/Makefile +++ b/docs/book/src/component-config-tutorial/testdata/project/Makefile @@ -2,7 +2,7 @@ # Image URL to use all building/pushing image targets IMG ?= controller:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.26.1 +ENVTEST_K8S_VERSION = 1.27.1 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) diff --git a/docs/book/src/cronjob-tutorial/testdata/project/Makefile b/docs/book/src/cronjob-tutorial/testdata/project/Makefile index 87dd37d4e2..ff938d19f0 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/Makefile +++ b/docs/book/src/cronjob-tutorial/testdata/project/Makefile @@ -2,7 +2,7 @@ # Image URL to use all building/pushing image targets IMG ?= controller:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.26.1 +ENVTEST_K8S_VERSION = 1.27.1 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) diff --git a/docs/book/src/multiversion-tutorial/testdata/project/Makefile b/docs/book/src/multiversion-tutorial/testdata/project/Makefile index fade7c4a85..7e7e062312 100644 --- a/docs/book/src/multiversion-tutorial/testdata/project/Makefile +++ b/docs/book/src/multiversion-tutorial/testdata/project/Makefile @@ -2,7 +2,7 @@ # Image URL to use all building/pushing image targets IMG ?= controller:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.26.1 +ENVTEST_K8S_VERSION = 1.27.1 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) diff --git a/pkg/plugin/util/testdata/exampleFile.txt b/pkg/plugin/util/testdata/exampleFile.txt index f2ec55449d..c0ddde7d31 100644 --- a/pkg/plugin/util/testdata/exampleFile.txt +++ b/pkg/plugin/util/testdata/exampleFile.txt @@ -1 +1 @@ -exampleTargetexampleCodeexampleCodeexampleCode \ No newline at end of file +exampleTargetexampleCodeexampleCodeexampleCodeexampleCodeexampleCodeexampleCode \ No newline at end of file diff --git a/pkg/plugins/golang/v3/commons.go b/pkg/plugins/golang/v3/commons.go index cd8c1eb867..5119a3dd73 100644 --- a/pkg/plugins/golang/v3/commons.go +++ b/pkg/plugins/golang/v3/commons.go @@ -79,7 +79,7 @@ manifests: controller-gen` } if err := util.ReplaceInFile("Makefile", - "ENVTEST_K8S_VERSION = 1.26.1", + "ENVTEST_K8S_VERSION = 1.27.1", "ENVTEST_K8S_VERSION = 1.21"); err != nil { log.Warnf("unable to update the Makefile with %s: %s", "ENVTEST_K8S_VERSION = 1.21", err) } diff --git a/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go b/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go index 2249c3350f..55b3b68b8e 100644 --- a/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go +++ b/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go @@ -62,7 +62,7 @@ const makefileTemplate = ` # Image URL to use all building/pushing image targets IMG ?= {{ .Image }} # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.26.1 +ENVTEST_K8S_VERSION = 1.27.1 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go index 9d6cf9b786..525ca3b890 100644 --- a/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go +++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go @@ -62,7 +62,7 @@ const makefileTemplate = ` # Image URL to use all building/pushing image targets IMG ?= {{ .Image }} # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.26.1 +ENVTEST_K8S_VERSION = 1.27.1 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) diff --git a/test/common.sh b/test/common.sh index ad85961dae..e6a93059bd 100644 --- a/test/common.sh +++ b/test/common.sh @@ -29,6 +29,7 @@ function convert_to_tools_ver { "1.24") echo "1.24.1";; "1.25") echo "1.25.0";; "1.26") echo "1.26.0";; + "1.27") echo "1.27.1";; *) echo "k8s version $k8s_ver not supported" exit 1 @@ -48,7 +49,7 @@ if [ -n "$TRACE" ]; then set -x fi -export KIND_K8S_VERSION="${KIND_K8S_VERSION:-"v1.26.1"}" +export KIND_K8S_VERSION="${KIND_K8S_VERSION:-"v1.27.1"}" tools_k8s_version=$(convert_to_tools_ver "${KIND_K8S_VERSION#v*}") kind_version=0.15.0 goarch=amd64 diff --git a/testdata/project-v3/Makefile b/testdata/project-v3/Makefile index 73a01c158d..250cf6a133 100644 --- a/testdata/project-v3/Makefile +++ b/testdata/project-v3/Makefile @@ -2,7 +2,7 @@ # Image URL to use all building/pushing image targets IMG ?= controller:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.26.1 +ENVTEST_K8S_VERSION = 1.27.1 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) diff --git a/testdata/project-v4-config/Makefile b/testdata/project-v4-config/Makefile index 6d6fe66b82..fc46ce845f 100644 --- a/testdata/project-v4-config/Makefile +++ b/testdata/project-v4-config/Makefile @@ -2,7 +2,7 @@ # Image URL to use all building/pushing image targets IMG ?= controller:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.26.1 +ENVTEST_K8S_VERSION = 1.27.1 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) diff --git a/testdata/project-v4-declarative-v1/Makefile b/testdata/project-v4-declarative-v1/Makefile index 6d6fe66b82..fc46ce845f 100644 --- a/testdata/project-v4-declarative-v1/Makefile +++ b/testdata/project-v4-declarative-v1/Makefile @@ -2,7 +2,7 @@ # Image URL to use all building/pushing image targets IMG ?= controller:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.26.1 +ENVTEST_K8S_VERSION = 1.27.1 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) diff --git a/testdata/project-v4-multigroup/Makefile b/testdata/project-v4-multigroup/Makefile index 6d6fe66b82..fc46ce845f 100644 --- a/testdata/project-v4-multigroup/Makefile +++ b/testdata/project-v4-multigroup/Makefile @@ -2,7 +2,7 @@ # Image URL to use all building/pushing image targets IMG ?= controller:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.26.1 +ENVTEST_K8S_VERSION = 1.27.1 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) diff --git a/testdata/project-v4-with-deploy-image/Makefile b/testdata/project-v4-with-deploy-image/Makefile index 6d6fe66b82..fc46ce845f 100644 --- a/testdata/project-v4-with-deploy-image/Makefile +++ b/testdata/project-v4-with-deploy-image/Makefile @@ -2,7 +2,7 @@ # Image URL to use all building/pushing image targets IMG ?= controller:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.26.1 +ENVTEST_K8S_VERSION = 1.27.1 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) diff --git a/testdata/project-v4-with-grafana/Makefile b/testdata/project-v4-with-grafana/Makefile index 6d6fe66b82..fc46ce845f 100644 --- a/testdata/project-v4-with-grafana/Makefile +++ b/testdata/project-v4-with-grafana/Makefile @@ -2,7 +2,7 @@ # Image URL to use all building/pushing image targets IMG ?= controller:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.26.1 +ENVTEST_K8S_VERSION = 1.27.1 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) diff --git a/testdata/project-v4/Makefile b/testdata/project-v4/Makefile index 6d6fe66b82..fc46ce845f 100644 --- a/testdata/project-v4/Makefile +++ b/testdata/project-v4/Makefile @@ -2,7 +2,7 @@ # Image URL to use all building/pushing image targets IMG ?= controller:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.26.1 +ENVTEST_K8S_VERSION = 1.27.1 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) From 801bd2022185809877bed3cab87f928a898be630 Mon Sep 17 00:00:00 2001 From: yyy1000 <992364620@qq.com> Date: Tue, 2 May 2023 17:45:17 +0800 Subject: [PATCH 2/2] fix: only update k8s version in go-v4 --- pkg/plugins/golang/v3/commons.go | 2 +- pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go | 2 +- testdata/project-v3/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/plugins/golang/v3/commons.go b/pkg/plugins/golang/v3/commons.go index 5119a3dd73..cd8c1eb867 100644 --- a/pkg/plugins/golang/v3/commons.go +++ b/pkg/plugins/golang/v3/commons.go @@ -79,7 +79,7 @@ manifests: controller-gen` } if err := util.ReplaceInFile("Makefile", - "ENVTEST_K8S_VERSION = 1.27.1", + "ENVTEST_K8S_VERSION = 1.26.1", "ENVTEST_K8S_VERSION = 1.21"); err != nil { log.Warnf("unable to update the Makefile with %s: %s", "ENVTEST_K8S_VERSION = 1.21", err) } diff --git a/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go b/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go index 55b3b68b8e..2249c3350f 100644 --- a/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go +++ b/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go @@ -62,7 +62,7 @@ const makefileTemplate = ` # Image URL to use all building/pushing image targets IMG ?= {{ .Image }} # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.27.1 +ENVTEST_K8S_VERSION = 1.26.1 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) diff --git a/testdata/project-v3/Makefile b/testdata/project-v3/Makefile index 250cf6a133..73a01c158d 100644 --- a/testdata/project-v3/Makefile +++ b/testdata/project-v3/Makefile @@ -2,7 +2,7 @@ # Image URL to use all building/pushing image targets IMG ?= controller:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.27.1 +ENVTEST_K8S_VERSION = 1.26.1 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN))