Skip to content

Commit 90d09e1

Browse files
⚠️ (go/v3) deprecate go/v3 in favor of go/v4 (#3238)
* ⚠️ deprecate go/v3 * Apply suggestions from code review * Update pkg/plugins/golang/v4/plugin.go Co-authored-by: Bryce Palmer <[email protected]> --------- Co-authored-by: Bryce Palmer <[email protected]>
1 parent 244a9e9 commit 90d09e1

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

docs/book/src/plugins/go-v3-plugin.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
# go/v3 (go.kubebuilder.io/v3)
1+
# [Deprecated] go/v3 (go.kubebuilder.io/v3)
2+
3+
<aside class="note warning">
4+
<h1>Deprecated</h1>
5+
6+
The `go/v3` cannot fully support Kubernetes 1.25+ and work with Kustomize versions > v3.
7+
8+
The recommended way to migrate a `v3` project is to create a new `v4` project and copy over the API
9+
and the reconciliation code. The conversion will end up with a project that looks like a native `v4` project.
10+
For further information check the [Migration guide](../migration/migration_guide_gov3_to_gov4.md)
11+
12+
</aside>
13+
214

315
Kubebuilder tool will scaffold the go/v3 plugin by default. This plugin is a composition of the plugins ` kustomize.common.kubebuilder.io/v1` and `base.go.kubebuilder.io/v3`. By using you can scaffold the default project which is a helper to construct sets of [controllers][controller-runtime].
416

@@ -23,8 +35,9 @@ As `go/v3` is the default plugin there is no need to explicitly mention to Kubeb
2335
To create a new project with the `go/v3` plugin the following command can be used:
2436

2537
```sh
26-
kubebuilder init --domain tutorial.kubebuilder.io --repo tutorial.kubebuilder.io/project
38+
kubebuilder init --plugins=`go/v3` --domain tutorial.kubebuilder.io --repo tutorial.kubebuilder.io/project
2739
```
40+
2841
All the other subcommands supported by the go/v3 plugin can be executed similarly.
2942

3043
<aside class="note">

pkg/plugins/golang/v4/plugin.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,11 @@ func (p Plugin) GetCreateWebhookSubcommand() plugin.CreateWebhookSubcommand {
6363

6464
// GetEditSubcommand will return the subcommand which is responsible for editing the scaffold of the project
6565
func (p Plugin) GetEditSubcommand() plugin.EditSubcommand { return &p.editSubcommand }
66+
67+
func (p Plugin) DeprecationWarning() string {
68+
return "This version is deprecated." +
69+
"The `go/v3` cannot scaffold projects using kustomize versions v4x+" +
70+
" and cannot fully support Kubernetes 1.25+." +
71+
"It is recommended to upgrade your project to the latest versions available (go/v4)." +
72+
"Please, check the migration guide to learn how to upgrade your project"
73+
}

0 commit comments

Comments
 (0)