Skip to content

Commit

Permalink
⚠️ (kustomize/v2-alpha, go/v4-alpha): Upgrade kustomize from 4.5.7 to…
Browse files Browse the repository at this point in the history
… 5.0.0 (#3199)

⚠️ (kustomize/v2-alpha, go/v4-alpha): Upgrade kustomize from 4.5.7 to 5.0.0 (#3199)
  • Loading branch information
Eileen-Yu committed Feb 4, 2023
1 parent 5bbe609 commit 60697e4
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions docs/book/src/migration/migration_guide_gov3_to_gov4.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ Now, let's copy the webhook definition from `api/v1/<kind>_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.
Expand Down
4 changes: 2 additions & 2 deletions docs/book/src/plugins/go-v4-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -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+`
Expand Down Expand Up @@ -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
[standard-go-project]: https://github.com/golang-standards/project-layout
8 changes: 4 additions & 4 deletions docs/book/src/plugins/kustomize-v2-alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ 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

<aside class="note">
<h1>Supportability</h1>

You can use `kustomize/v1` plugin which is the default configuration adopted by the `go/v3` plugin if you are not prepared to began to experiment kustomize `v4`.
You can use `kustomize/v1` plugin which is the default configuration adopted by the `go/v3` plugin if you are not prepared to began to experiment kustomize `v5`.
Also, be aware that the `base.go.kubebuilder.io/v3` is prepared to work with this plugin.

</aside>
Expand Down Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion pkg/plugins/common/kustomize/v2-alpha/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/common/kustomize/v2-alpha/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-config/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-declarative-v1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-multigroup/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-with-deploy-image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 60697e4

Please sign in to comment.