From 28c8cc5fe6a8c40c4c5017f690c601d7dd4b9aa8 Mon Sep 17 00:00:00 2001 From: Eileen Date: Fri, 3 Feb 2023 15:10:12 -0500 Subject: [PATCH] feat: Bump kustomize from v4 to v5 --- docs/book/src/migration/migration_guide_gov3_to_gov4.md | 4 ++-- docs/book/src/plugins/go-v4-plugin.md | 4 ++-- docs/book/src/plugins/kustomize-v2-alpha.md | 8 ++++---- pkg/plugins/common/kustomize/v2-alpha/init.go | 2 +- pkg/plugins/common/kustomize/v2-alpha/plugin.go | 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/Makefile | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/book/src/migration/migration_guide_gov3_to_gov4.md b/docs/book/src/migration/migration_guide_gov3_to_gov4.md index a62bb33cc91..543662376fc 100644 --- a/docs/book/src/migration/migration_guide_gov3_to_gov4.md +++ b/docs/book/src/migration/migration_guide_gov3_to_gov4.md @@ -119,8 +119,8 @@ Now, let's copy the webhook definition from `api/v1/_webhook.go` from our If there are any manual updates in `main.go` in v3, we need to port the changes to the new `main.go`. We’ll also need to ensure all of needed controller-runtime `schemes` have been registered. If there are additional manifests added under config directory, port them as well. Please, be aware that -the new version go/v4-alpha uses Kustomize v4x and no longer Kustomize v3. Therefore, if added customized -implementations in the config you need to ensure that them can work with Kustomize v4 and/if not +the new version go/v4-alpha uses Kustomize v5x and no longer Kustomize v4. Therefore, if added customized +implementations in the config you need to ensure that them can work with Kustomize v5 and/if not update/upgrade any breaking change that you might face. Change the image name in the Makefile if needed. diff --git a/docs/book/src/plugins/go-v4-plugin.md b/docs/book/src/plugins/go-v4-plugin.md index 8f2a98b9fca..464815bd455 100644 --- a/docs/book/src/plugins/go-v4-plugin.md +++ b/docs/book/src/plugins/go-v4-plugin.md @@ -20,7 +20,7 @@ under the [testdata][testdata] directory on the root directory of the Kubebuilde - If you are looking to scaffold Golang projects to develop projects using [controllers][controller-runtime] - If you are looking to experiment with the future default scaffold that will be provided by Kubebuilder CLI - If your local environment is Apple Silicon (`darwin/arm64`) -- If you are looking to use [kubernetes-sigs/kustomize][kustomize] v4 +- If you are looking to use [kubernetes-sigs/kustomize][kustomize] v5 - If you are looking to have your project update with the latest version available - if you are not targeting k8s versions < `1.16` and `1.20` if you are using webhooks - If you are looking to work on with scaffolds which are compatible with k8s `1.25+` @@ -64,4 +64,4 @@ kubebuilder init --domain tutorial.kubebuilder.io --repo tutorial.kubebuilder.io [plugins-main]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/cmd/main.go [kustomize-plugin]: ../plugins/kustomize-v2-alpha.md [kustomize]: https://github.com/kubernetes-sigs/kustomize -[standard-go-project]: https://github.com/golang-standards/project-layout \ No newline at end of file +[standard-go-project]: https://github.com/golang-standards/project-layout diff --git a/docs/book/src/plugins/kustomize-v2-alpha.md b/docs/book/src/plugins/kustomize-v2-alpha.md index 728cfe4e996..c599f513f02 100644 --- a/docs/book/src/plugins/kustomize-v2-alpha.md +++ b/docs/book/src/plugins/kustomize-v2-alpha.md @@ -21,7 +21,7 @@ directory of the Kubebuilder project. - If you are looking to scaffold the kustomize configuration manifests for your own language plugin - If you are looking for support on Apple Silicon (`darwin/arm64`). (_Before kustomize `4.x` the binary for this plataform is not provided_) -- If you are looking for to begin to try out the new syntax and features provide by kustomize v4 +- If you are looking for to begin to try out the new syntax and features provide by kustomize v5 - If you are NOT looking to build projects which will be used on Kubernetes cluster versions < `1.22` (_The new features provides by kustomize v4 are not officially supported and might not work with kubectl < `1.22`_) - If you are NOT looking to rely on special URLs in resource fields - If you want to use [replacements][kustomize-replacements] since [vars][kustomize-vars] are deprecated and might be removed soon @@ -29,7 +29,7 @@ directory of the Kubebuilder project. @@ -107,7 +107,7 @@ The following scaffolds will be created or updated by this plugin: * Check the kustomize [plugin implementation](https://github.com/kubernetes-sigs/kubebuilder/tree/master/pkg/plugins/common/kustomize) * Check the [kustomize documentation][kustomize-docs] * Check the [kustomize repository][kustomize-github] -* To know more about the changes between kustomize v3 and v3 see its [release notes][release-notes] +* To know more about the changes between kustomize v4 and v5 see its [release notes][release-notes] * Also, you can compare the `config/` directory between the samples `project-v3` and `project-v3-with-kustomize-v2` to check the difference in the syntax of the manifests provided by default [sdk]:https://github.com/operator-framework/operator-sdk @@ -118,4 +118,4 @@ The following scaffolds will be created or updated by this plugin: [kustomize-github]: https://github.com/kubernetes-sigs/kustomize [kustomize-replacements]: https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/replacements/ [kustomize-vars]: https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/vars/ -[release-notes]: https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv4.0.0 +[release-notes]: https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv5.0.0 diff --git a/pkg/plugins/common/kustomize/v2-alpha/init.go b/pkg/plugins/common/kustomize/v2-alpha/init.go index 330318cae40..2c37d19aec0 100644 --- a/pkg/plugins/common/kustomize/v2-alpha/init.go +++ b/pkg/plugins/common/kustomize/v2-alpha/init.go @@ -47,7 +47,7 @@ func (p *initSubcommand) UpdateMetadata(cliMeta plugin.CLIMetadata, subcmdMeta * - a "PROJECT" file that stores project configuration - several YAML files for project deployment under the "config" directory -NOTE: This plugin requires kustomize version v4 and kubectl >= 1.22. +NOTE: This plugin requires kustomize version v5 and kubectl >= 1.22. ` subcmdMeta.Examples = fmt.Sprintf(` # Initialize a common project with your domain and name in copyright %[1]s init --plugins common/v3 --domain example.org diff --git a/pkg/plugins/common/kustomize/v2-alpha/plugin.go b/pkg/plugins/common/kustomize/v2-alpha/plugin.go index fd0365296e0..30e05d33c99 100644 --- a/pkg/plugins/common/kustomize/v2-alpha/plugin.go +++ b/pkg/plugins/common/kustomize/v2-alpha/plugin.go @@ -25,7 +25,7 @@ import ( ) // KustomizeVersion is the kubernetes-sigs/kustomize version to be used in the project -const KustomizeVersion = "v4.5.7" +const KustomizeVersion = "v5.0.0" const pluginName = "kustomize.common." + plugins.DefaultNameQualifier diff --git a/testdata/project-v4-config/Makefile b/testdata/project-v4-config/Makefile index 971bfb70e69..b576bf20e1b 100644 --- a/testdata/project-v4-config/Makefile +++ b/testdata/project-v4-config/Makefile @@ -132,7 +132,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen ENVTEST ?= $(LOCALBIN)/setup-envtest ## Tool Versions -KUSTOMIZE_VERSION ?= v4.5.7 +KUSTOMIZE_VERSION ?= v5.0.0 CONTROLLER_TOOLS_VERSION ?= v0.11.1 KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" diff --git a/testdata/project-v4-declarative-v1/Makefile b/testdata/project-v4-declarative-v1/Makefile index 971bfb70e69..b576bf20e1b 100644 --- a/testdata/project-v4-declarative-v1/Makefile +++ b/testdata/project-v4-declarative-v1/Makefile @@ -132,7 +132,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen ENVTEST ?= $(LOCALBIN)/setup-envtest ## Tool Versions -KUSTOMIZE_VERSION ?= v4.5.7 +KUSTOMIZE_VERSION ?= v5.0.0 CONTROLLER_TOOLS_VERSION ?= v0.11.1 KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" diff --git a/testdata/project-v4-multigroup/Makefile b/testdata/project-v4-multigroup/Makefile index 971bfb70e69..b576bf20e1b 100644 --- a/testdata/project-v4-multigroup/Makefile +++ b/testdata/project-v4-multigroup/Makefile @@ -132,7 +132,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen ENVTEST ?= $(LOCALBIN)/setup-envtest ## Tool Versions -KUSTOMIZE_VERSION ?= v4.5.7 +KUSTOMIZE_VERSION ?= v5.0.0 CONTROLLER_TOOLS_VERSION ?= v0.11.1 KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" diff --git a/testdata/project-v4-with-deploy-image/Makefile b/testdata/project-v4-with-deploy-image/Makefile index 971bfb70e69..b576bf20e1b 100644 --- a/testdata/project-v4-with-deploy-image/Makefile +++ b/testdata/project-v4-with-deploy-image/Makefile @@ -132,7 +132,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen ENVTEST ?= $(LOCALBIN)/setup-envtest ## Tool Versions -KUSTOMIZE_VERSION ?= v4.5.7 +KUSTOMIZE_VERSION ?= v5.0.0 CONTROLLER_TOOLS_VERSION ?= v0.11.1 KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" diff --git a/testdata/project-v4/Makefile b/testdata/project-v4/Makefile index 971bfb70e69..b576bf20e1b 100644 --- a/testdata/project-v4/Makefile +++ b/testdata/project-v4/Makefile @@ -132,7 +132,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen ENVTEST ?= $(LOCALBIN)/setup-envtest ## Tool Versions -KUSTOMIZE_VERSION ?= v4.5.7 +KUSTOMIZE_VERSION ?= v5.0.0 CONTROLLER_TOOLS_VERSION ?= v0.11.1 KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"