Skip to content

Commit 014e08c

Browse files
⚠️ (go/v4-alpha) stabilize go/v4 plugin. Plugin go/v4-alpha replaced with go/v4 (#3237)
1 parent 56bbc88 commit 014e08c

File tree

27 files changed

+75
-88
lines changed

27 files changed

+75
-88
lines changed

README.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,7 @@ supporting Windows are welcome.
127127

128128
### Apple Silicon
129129

130-
Apple Silicon (`darwin/arm64`) is supported using the `go/v4-alpha` plugin which provides support for this platform.
131-
132-
```bash
133-
kubebuilder init --domain my.domain --repo my.domain/guestbook --plugins=go/v4-alpha
134-
```
135-
136-
**Note**: The `go/v4-alpha` plugin is an unstable version and can have breaking changes in future releases. The previous kustomize
137-
version (`v3.Y.Z`) used in the `go/v3` has no available binaries for this
138-
platform [kubernetes-sigs/kustomize/issues/4612](https://github.com/kubernetes-sigs/kustomize/issues/4612)
139-
Because of this, we cannot support this `darwin/arm64` on the stable scaffold done by default with the Kubebuilder with the `go/v3` plugin.
130+
Apple Silicon (`darwin/arm64`) support begins with the `go/v4` plugin.
140131

141132
## Community Meetings
142133

cmd/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
cfgv2 "sigs.k8s.io/kubebuilder/v3/pkg/config/v2"
2626
cfgv3 "sigs.k8s.io/kubebuilder/v3/pkg/config/v3"
2727
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
28-
"sigs.k8s.io/kubebuilder/v3/pkg/model/stage"
2928
"sigs.k8s.io/kubebuilder/v3/pkg/plugin"
3029
kustomizecommonv1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v1"
3130
kustomizecommonv2alpha "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v2"
@@ -46,7 +45,7 @@ func main() {
4645
golangv3.Plugin{},
4746
)
4847
// Bundle plugin which built the golang projects scaffold by Kubebuilder go/v4 with kustomize alpha-v2
49-
gov4Bundle, _ := plugin.NewBundle(golang.DefaultNameQualifier, plugin.Version{Number: 4, Stage: stage.Alpha},
48+
gov4Bundle, _ := plugin.NewBundle(golang.DefaultNameQualifier, plugin.Version{Number: 4},
5049
kustomizecommonv2alpha.Plugin{},
5150
golangv4.Plugin{},
5251
)

docs/book/src/SUMMARY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
- [Migration Guide](migration/legacy/migration_guide_v2tov3.md)
6969
- [Migration by updating the files](migration/legacy/manually_migration_guide_v2_v3.md)
7070
- [From v3.0.0 with plugins](./migration/v3-plugins.md)
71-
- [go/v3 vs go/v4-alpha](migration/v3vsv4.md)
71+
- [go/v3 vs go/v4](migration/v3vsv4.md)
7272

7373
- [Migration Guide](migration/migration_guide_gov3_to_gov4.md)
7474
- [Migration by updating the files](migration/manually_migration_guide_gov3_to_gov4.md)
@@ -117,7 +117,7 @@
117117
- [To scaffold a project](./plugins/to-scaffold-project.md)
118118
- [go/v2 (Deprecated)](./plugins/go-v2-plugin.md)
119119
- [go/v3 (Default init scaffold)](./plugins/go-v3-plugin.md)
120-
- [go/v4-alpha](./plugins/go-v4-plugin.md)
120+
- [go/v4](./plugins/go-v4-plugin.md)
121121
- [To add optional features](./plugins/to-add-optional-features.md)
122122
- [declarative/v1](./plugins/declarative-v1.md)
123123
- [grafana/v1-alpha](./plugins/grafana-v1-alpha.md)

docs/book/src/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ After creating a project, usually you will want to extend the Kubernetes APIs an
88
The domain is for the group suffix, to explicitly show the resource group category.
99
For example, if set `--domain=example.com`:
1010
```
11-
kubebuilder init --domain example.com --repo xxx --plugins=go/v4-alpha
11+
kubebuilder init --domain example.com --repo xxx --plugins=go/v4
1212
kubebuilder create api --group mygroup --version v1beta1 --kind Mykind
1313
```
1414
Then the result resource group will be `mygroup.example.com`.

docs/book/src/migration/legacy/v2vsv3.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,13 @@ So you want to upgrade your scaffolding to use the latest and greatest features
6666
<h1> Apple Silicon (M1) </h1>
6767

6868
The current scaffold done by the CLI (`go/v3`) uses [kubernetes-sigs/kustomize][kustomize] v3 which does not provide
69-
a valid binary for Apple Silicon (`darwin/arm64`). Therefore, you can use the `go/v4-alpha` plugin
69+
a valid binary for Apple Silicon (`darwin/arm64`). Therefore, you can use the `go/v4` plugin
7070
instead which provides support for this platform:
7171

7272
```bash
73-
kubebuilder init --domain my.domain --repo my.domain/guestbook --plugins=go/v4-alpha
73+
kubebuilder init --domain my.domain --repo my.domain/guestbook --plugins=go/v4
7474
```
7575

76-
**Note**: The `go/v4-alpha` plugin is an unstable version and can have breaking changes in future releases.
77-
The steps to migrate your project from v2 to v3 using the `alpha` scaffold are the same.
7876
</aside>
7977

8078
- [Migration Guide v2 to V3][migration-guide-v2-to-v3] **(Recommended)**

docs/book/src/migration/manually_migration_guide_gov3_to_gov4.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# Migration from go/v3 to go/v4-alpha by updating the files manually
1+
# Migration from go/v3 to go/v4 by updating the files manually
22

3-
Make sure you understand the [differences between Kubebuilder go/v3 and go/v4-alpha][v3vsv4]
3+
Make sure you understand the [differences between Kubebuilder go/v3 and go/v4][v3vsv4]
44
before continuing.
55

66
Please ensure you have followed the [installation guide][quick-start]
77
to install the required components.
88

9-
The following guide describes the manual steps required to upgrade your PROJECT config file to begin using `go/v4-alpha`.
9+
The following guide describes the manual steps required to upgrade your PROJECT config file to begin using `go/v4`.
1010

1111
This way is more complex, susceptible to errors, and success cannot be assured. Also, by following these steps you will not get the improvements and bug fixes in the default generated project files.
1212

1313
Usually it is suggested to do it manually if you have customized your project and deviated too much from the proposed scaffold. Before continuing, ensure that you understand the note about [project customizations][project-customizations]. Note that you might need to spend more effort to do this process manually than to organize your project customizations. The proposed layout will keep your project maintainable and upgradable with less effort in the future.
1414

15-
The recommended upgrade approach is to follow the [Migration Guide go/v3 to go/v4-alpha][migration-guide-gov3-to-gov4] instead.
15+
The recommended upgrade approach is to follow the [Migration Guide go/v3 to go/v4][migration-guide-gov3-to-gov4] instead.
1616

1717
## Migration from project config version "go/v3" to "go/v4"
1818

@@ -37,7 +37,7 @@ With:
3737
3838
```yaml
3939
layout:
40-
- go.kubebuilder.io/v4-alpha
40+
- go.kubebuilder.io/v4
4141

4242
```
4343
@@ -152,15 +152,15 @@ The PROJECT tracks the paths of all APIs used in your project. Ensure that they
152152
153153
### Update kustomize manifests with the changes made so far
154154
155-
- Update the manifest under `config/` directory with all changes performed in the default scaffold done with `go/v4-alpha` plugin. (see for example `testdata/project-v4/config/`) to get all changes in the
155+
- Update the manifest under `config/` directory with all changes performed in the default scaffold done with `go/v4` plugin. (see for example `testdata/project-v4/config/`) to get all changes in the
156156
default scaffolds to be applied on your project
157157
- Create `config/samples/kustomization.yaml` with all Custom Resources samples specified into `config/samples`. _(see for example `testdata/project-v4/config/samples/kustomization.yaml`)_
158158
159159
<aside class="warning">
160160
<h1>`config/` directory with changes into the scaffold files</h1>
161161
162162
Note that under the `config/` directory you will find scaffolding changes since using
163-
`go/v4-alpha` you will ensure that you are no longer using Kustomize v3x.
163+
`go/v4` you will ensure that you are no longer using Kustomize v3x.
164164
165165
You can mainly compare the `config/` directory from the samples scaffolded under the `testdata`directory by
166166
checking the differences between the `testdata/project-v3/config/` with `testdata/project-v4/config/` which
@@ -189,11 +189,11 @@ Update the `go.mod` with the changes which can be found in the samples under `te
189189
### Verification
190190
191191
In the steps above, you updated your project manually with the goal of ensuring that it follows
192-
the changes in the layout introduced with the `go/v4-alpha` plugin that update the scaffolds.
192+
the changes in the layout introduced with the `go/v4` plugin that update the scaffolds.
193193
194194
There is no option to verify that you properly updated the `PROJECT` file of your project.
195-
The best way to ensure that everything is updated correctly, would be to initialize a project using the `go/v4-alpha` plugin,
196-
(ie) using `kubebuilder init --domain tutorial.kubebuilder.io plugins=go/v4-alpha` and generating the same API(s),
195+
The best way to ensure that everything is updated correctly, would be to initialize a project using the `go/v4` plugin,
196+
(ie) using `kubebuilder init --domain tutorial.kubebuilder.io plugins=go/v4` and generating the same API(s),
197197
controller(s), and webhook(s) in order to compare the generated configuration with the manually changed configuration.
198198
199199
Also, after all updates you would run the following commands:

docs/book/src/migration/migration_guide_gov3_to_gov4.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# Migration from go/v3 to go/v4-alpha
1+
# Migration from go/v3 to go/v4
22

3-
Make sure you understand the [differences between Kubebuilder go/v3 and go/v4-alpha][v3vsv4]
3+
Make sure you understand the [differences between Kubebuilder go/v3 and go/v4][v3vsv4]
44
before continuing.
55

66
Please ensure you have followed the [installation guide][quick-start]
77
to install the required components.
88

9-
The recommended way to migrate a go/v3 project is to create a new go/v4-alpha project and
9+
The recommended way to migrate a `go/v3` project is to create a new `go/v4` project and
1010
copy over the API and the reconciliation code. The conversion will end up with a
11-
project that looks like a native go/v4-alpha project layout (latest version).
11+
project that looks like a native go/v4 project layout (latest version).
1212

1313
However, in some cases, it's possible to do an in-place upgrade (i.e. reuse the go/v3 project layout, upgrading
14-
the PROJECT file, and scaffolds manually). For further information see [Migration from go/v3 to go/v4-alpha by updating the files manually][manually-upgrade]
14+
the PROJECT file, and scaffolds manually). For further information see [Migration from go/v3 to go/v4 by updating the files manually][manually-upgrade]
1515

16-
## Initialize a go/v4-alpha Project
16+
## Initialize a go/v4 Project
1717

1818
<aside class="note">
1919
<h1>Project name</h1>
@@ -30,7 +30,7 @@ $ mkdir migration-project-name
3030
$ cd migration-project-name
3131
```
3232

33-
Now, we need to initialize a go/v4-alpha project. Before we do that, we'll need
33+
Now, we need to initialize a go/v4 project. Before we do that, we'll need
3434
to initialize a new go module if we're not on the `GOPATH`. While technically this is
3535
not needed inside `GOPATH`, it is still recommended.
3636

@@ -50,7 +50,7 @@ module tutorial.kubebuilder.io/migration-project
5050
Now, we can finish initializing the project with kubebuilder.
5151

5252
```bash
53-
kubebuilder init --domain tutorial.kubebuilder.io --plugins=go/v4-alpha
53+
kubebuilder init --domain tutorial.kubebuilder.io --plugins=go/v4
5454
```
5555

5656
<aside class="note">
@@ -119,7 +119,7 @@ Now, let's copy the webhook definition from `api/v1/<kind>_webhook.go` from our
119119
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.
120120

121121
If there are additional manifests added under config directory, port them as well. Please, be aware that
122-
the new version go/v4-alpha uses Kustomize v5x and no longer Kustomize v4. Therefore, if added customized
122+
the new version go/v4 uses Kustomize v5x and no longer Kustomize v4. Therefore, if added customized
123123
implementations in the config you need to ensure that them can work with Kustomize v5 and/if not
124124
update/upgrade any breaking change that you might face.
125125

docs/book/src/migration/multi-group.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ to modify the default project structure to support it.
2121
Let's migrate the [CronJob example][cronjob-tutorial].
2222

2323
<aside class="note warning">
24-
<h1>Using go/v4-alpha</h1>
24+
<h1>Using go/v4</h1>
2525

26-
If you create your project using go/v4-alpha plugin (you can verify it by looking at the PROJECT file )
26+
If you create your project using go/v4 plugin (you can verify it by looking at the PROJECT file )
2727
then, all steps are the same but you need to keep in mind that the api and controllers directory
2828
path is now under the `pkg` directory instead. So, you need ensure that you update the
2929
paths accordingly.

docs/book/src/migration/v3vsv4.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# go/v3 vs go/v4-alpha
1+
# go/v3 vs go/v4
22

3-
This document covers all breaking changes when migrating from projects built using the plugin go/v3 (default for any scaffold done since `28 Apr 2021`) to the next alpha version of the Golang plugin `go/v4-alpha`.
3+
This document covers all breaking changes when migrating from projects built using the plugin go/v3 (default for any scaffold done since `28 Apr 2021`) to the next alpha version of the Golang plugin `go/v4`.
44

55
The details of all changes (breaking or otherwise) can be found in:
66

@@ -11,7 +11,7 @@ The details of all changes (breaking or otherwise) can be found in:
1111

1212
## Common changes
1313

14-
- `go/v4-alpha` projects use Kustomize v4x (instead of v3x)
14+
- `go/v4` projects use Kustomize v5x (instead of v3x)
1515
- note that some manifests under `config/` directory have been changed in order to no longer use the deprecated Kustomize features
1616
such as env vars.
1717
- A `kustomization.yaml` is scaffolded under `config/samples`. This helps simply and flexibly generate sample manifests: `kustomize build config/samples`.
@@ -24,13 +24,13 @@ The details of all changes (breaking or otherwise) can be found in:
2424
by moving the api(s) under a new directory called `api`, controller(s) under a new directory called `internal` and the `main.go` under a new directory named `cmd`
2525

2626
<aside class="note">
27-
<H1> TL;DR of the New `go/v4-alpha` Plugin </H1>
27+
<H1> TL;DR of the New `go/v4` Plugin </H1>
2828

29-
Further details can be found in the [go/v4-alpha plugin section][go/v4-doc]
29+
Further details can be found in the [go/v4 plugin section][go/v4-doc]
3030

3131
</aside>
3232

33-
## TL;DR of the New `go/v4-alpha` Plugin
33+
## TL;DR of the New `go/v4` Plugin
3434

3535
**_More details on this can be found at [here][kb-releases], but for the highlights, check below_**
3636

@@ -49,7 +49,7 @@ For example, you should refrain from moving the scaffolded files, doing so will
4949

5050
</aside>
5151

52-
## Migrating to Kubebuilder go/v4-alpha
52+
## Migrating to Kubebuilder go/v4
5353

5454
If you want to upgrade your scaffolding to use the latest and greatest features then, follow the guide
5555
which will cover the steps in the most straightforward way to allow you to upgrade your project to get all
@@ -59,14 +59,14 @@ latest changes and improvements.
5959
<h1> Apple Silicon (M1) </h1>
6060

6161
The current scaffold done by the CLI (`go/v3`) uses [kubernetes-sigs/kustomize][kustomize] v3 which does not provide
62-
a valid binary for Apple Silicon (`darwin/arm64`). Therefore, you can use the `go/v4-alpha` plugin
62+
a valid binary for Apple Silicon (`darwin/arm64`). Therefore, you can use the `go/v4` plugin
6363
instead which provides support for this platform:
6464

6565
```bash
66-
kubebuilder init --domain my.domain --repo my.domain/guestbook --plugins=go/v4-alpha
66+
kubebuilder init --domain my.domain --repo my.domain/guestbook --plugins=go/v4
6767
```
6868

69-
**Note**: The `go/v4-alpha` plugin is an unstable version and can have breaking changes in future releases.
69+
**Note**: The `go/v4` plugin is an unstable version and can have breaking changes in future releases.
7070

7171
</aside>
7272

@@ -78,7 +78,7 @@ If you want to use the latest version of Kubebuilder CLI without changing your s
7878

7979
This way is more complex, susceptible to errors, and success cannot be assured. Also, by following these steps you will not get the improvements and bug fixes in the default generated project files.
8080

81-
- [Migrating to go/v4-alpha by updating the files manually][manually-upgrade]
81+
- [Migrating to go/v4 by updating the files manually][manually-upgrade]
8282

8383
[plugins-phase1-design-doc]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/designs/extensible-cli-and-scaffolding-plugins-phase-1.md
8484
[plugins-phase1-design-doc-1.5]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/designs/extensible-cli-and-scaffolding-plugins-phase-1-5.md

docs/book/src/plugins/creating-plugins.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ You might want for example to overwrite a scaffold done by using the option:
147147
f.IfExistsAction = machinery.OverwriteFile
148148
```
149149

150-
Let's imagine that you would like to have a helper plugin that would be called in a chain with `go/v4-alpha` to add customizations on top.
151-
Therefore after we generate the code calling the subcommand to `init` from `go/v4-alpha` we would like to overwrite the Makefile to change this scaffold via our plugin.
150+
Let's imagine that you would like to have a helper plugin that would be called in a chain with `go/v4` to add customizations on top.
151+
Therefore after we generate the code calling the subcommand to `init` from `go/v4` we would like to overwrite the Makefile to change this scaffold via our plugin.
152152
In this way, we would implement the Bollerplate for our Makefile and then use this option to ensure that it would be overwritten.
153153

154154
See [example of deploy-image][example-of-deploy-image-1].

0 commit comments

Comments
 (0)