Skip to content

Commit 8571f9c

Browse files
authored
Merge pull request #3930 from camilamacedo86/foc-helper-upgrade
📖 doc/cleanup: remove reference of legacy plugins
2 parents 1d7cf5f + d1ff5dc commit 8571f9c

9 files changed

+36
-40
lines changed

designs/helper_to_upgrade_projects_by_rescaffolding.md

-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ make less painful this process. Examples:
8383
- Deal with customizations or deviations from the proposed layout
8484
- Be able to perform the project upgrade to the latest changes without human interactions
8585
- Deal and support external plugins
86-
- Provides support to [declarative](https://book.kubebuilder.io/plugins/declarative-v1.html) plugin
87-
since it is desired and planned to decouple this solution and donate this plugin to its own authors [More info](https://github.com/kubernetes-sigs/kubebuilder/issues/3186)
8886
- Provide support to older version before having the Project config (Kubebuilder < 3x) and the go/v2 layout which exists to ensure a backwards compatibility with legacy layout provided by Kubebuilder 2x
8987

9088
## Proposal

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ This is common as you may expect your plugin to:
143143

144144
The Kubebuilder internal plugins use boilerplates to generate the files of code.
145145

146-
For instance, the go/v3 scaffolds the `main.go` file by defining an object that [implements the machinery interface][kubebuilder-machinery].
146+
For instance, the go/v4 scaffolds the `main.go` file by defining an object that [implements the machinery interface][kubebuilder-machinery].
147147
In the [implementation][go-v3-settemplatedefault] of `Template.SetTemplateDefaults`, the [raw template][go-v3-main-template] is set to the body.
148148
Such object that implements the machinery interface will later pass to the [execution of scaffold][go-v3-scaffold-execute].
149149

docs/book/src/plugins/extending-cli.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ var (
4141

4242
// GetPluginsCLI returns the plugins based CLI configured to be used in your CLI binary
4343
func GetPluginsCLI() (*cli.CLI) {
44-
// Bundle plugin which built the golang projects scaffold by Kubebuilder go/v3
44+
// Bundle plugin which built the golang projects scaffold by Kubebuilder go/v4
4545
gov3Bundle, _ := plugin.NewBundleWithOptions(plugin.WithName(golang.DefaultNameQualifier),
4646
plugin.WithVersion(plugin.Version{Number: 3}),
47-
plugin.WithPlugins(kustomizecommonv2.Plugin{}, golangv3.Plugin{}),
47+
plugin.WithPlugins(kustomizecommonv2.Plugin{}, golangv4.Plugin{}),
4848
)
4949

5050

docs/book/src/plugins/kustomize-v2.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ all that is language specific and kustomize for its configuration, see:
3636
```go
3737
import (
3838
...
39-
kustomizecommonv2alpha "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v2"
39+
kustomizecommonv2 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v2"
4040
golangv4 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v4"
4141
...
4242
)
4343

44-
// Bundle plugin which built the golang projects scaffold by Kubebuilder go/v3
44+
// Bundle plugin which built the golang projects scaffold by Kubebuilder go/v4
4545
// The follow code is creating a new plugin with its name and version via composition
4646
// You can define that one plugin is composite by 1 or Many others plugins
4747
gov3Bundle, _ := plugin.NewBundle(plugin.WithName(golang.DefaultNameQualifier),
4848
plugin.WithVersion(plugin.Version{Number: 3}),
49-
plugin.WithPlugins(kustomizecommonv2.Plugin{}, golangv3.Plugin{}), // scaffold the config/ directory and all kustomize files
49+
plugin.WithPlugins(kustomizecommonv2.Plugin{}, golangv4.Plugin{}), // scaffold the config/ directory and all kustomize files
5050
// Scaffold the Golang files and all that specific for the language e.g. go.mod, apis, controllers
5151
)
5252
```
@@ -68,7 +68,7 @@ drwx------ 6 camilamacedo86 staff 192 31 Mar 09:56 config
6868
Or combined with the base language plugins:
6969

7070
```sh
71-
# Provides the same scaffold of go/v3 plugin which is composition but with kustomize/v2
71+
# Provides the same scaffold of go/v4 plugin which is composition but with kustomize/v2
7272
kubebuilder init --plugins=kustomize/v2,base.go.kubebuilder.io/v4 --domain example.org --repo example.org/guestbook-operator
7373
```
7474

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ For example, Kubebuilder generate [sample projects](https://github.com/kubernete
4242
Simply, you can also use `TextContext` to generate folders of scaffolded projects from your plugin.
4343
The commands are very similar as mentioned in [creating-plugins](creating-plugins.md#write-e2e-tests).
4444

45-
Following is a general workflow to create a sample by the plugin `go/v3`: (`kbc` is an instance of `TextContext`)
45+
Following is a general workflow to create a sample by the plugin `go/v4`: (`kbc` is an instance of `TextContext`)
4646

4747
- To initialized a project:
4848
```go
4949
By("initializing a project")
5050
err = kbc.Init(
51-
"--plugins", "go/v3",
51+
"--plugins", "go/v4",
5252
"--project-version", "3",
5353
"--domain", kbc.Domain,
5454
"--fetch-deps=false",

docs/book/src/plugins/to-be-extended.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ the base language plugins which are responsible for to scaffold the Golang files
1313
another languages (i.e. [Operator-SDK][sdk] does to allow users work with Ansible/Helm) or to add
1414
helpers on top, such as [Operator-SDK][sdk] does to add their features to integrate the projects with [OLM][olm].
1515

16-
| Plugin | Key | Description |
17-
| ---------------------------------------------------------------------------------- |-----------------------------| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
18-
| [kustomize.common.kubebuilder.io/v1](https://github.com/kubernetes-sigs/kubebuilder/pull/3235/kustomize-v1.md) | kustomize/v1 (Deprecated) | Responsible for scaffolding all manifests to configure projects with [kustomize(v3)][kustomize]. (create and update the `config/` directory). This plugin is used in the composition to create the plugin (`go/v3`). |
19-
| [kustomize.common.kubebuilder.io/v2](kustomize-v2.md) | `kustomize/v2` | It has the same purpose of `kustomize/v1`. However, it works with [kustomize][kustomize] version `v4` and addresses the required changes for future kustomize configurations. It will probably be used with the future `go/v4-alpha` plugin. |
20-
| `base.go.kubebuilder.io/v3` | `base/v3` | Responsible for scaffolding all files that specifically require Golang. This plugin is used in composition to create the plugin (`go/v3`) |
21-
| `base.go.kubebuilder.io/v4` | `base/v4` | Responsible for scaffolding all files which specifically requires Golang. This plugin is used in the composition to create the plugin (`go/v4`) |
16+
| Plugin | Key | Description |
17+
| ---------------------------------------------------------------------------------- |-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
18+
| [kustomize.common.kubebuilder.io/v2](kustomize-v2.md) | `kustomize/v2` | Responsible for scaffolding all [kustomize][kustomize] files under the `config/` directory |
19+
| `base.go.kubebuilder.io/v4` | `base/v4` | Responsible for scaffolding all files which specifically requires Golang. This plugin is used in the composition to create the plugin (`go/v4`) |
2220

2321
[create-plugins]: creating-plugins.md
2422
[kustomize]: https://kustomize.io/

docs/book/src/reference/envtest.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,5 +322,5 @@ testEnv = &envtest.Environment{
322322
[envtest]: https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/envtest
323323
[setup-envtest]: https://pkg.go.dev/sigs.k8s.io/controller-runtime/tools/setup-envtest
324324
[cert-manager]: https://book.kubebuilder.io/cronjob-tutorial/cert-manager.html
325-
[sdk-e2e-sample-example]: https://github.com/operator-framework/operator-sdk/tree/master/testdata/go/v3/memcached-operator/test/e2e
325+
[sdk-e2e-sample-example]: https://github.com/operator-framework/operator-sdk/tree/master/testdata/go/v4/memcached-operator/test/e2e
326326
[sdk]: https://github.com/operator-framework/operator-sdk

docs/book/src/reference/project-config.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -130,28 +130,28 @@ version: "3"
130130

131131
Now let's check its layout fields definition:
132132

133-
| Field | Description |
134-
|----------|-------------|
135-
| `layout` | Defines the global plugins, e.g. a project `init` with `--plugins="go/v3,declarative"` means that any sub-command used will always call its implementation for both plugins in a chain. |
136-
| `domain` | Store the domain of the project. This information can be provided by the user when the project is generate with the `init` sub-command and the `domain` flag. |
137-
| `plugins` | Defines the plugins used to do custom scaffolding, e.g. to use the optional `declarative` plugin to do scaffolding for just a specific api via the command `kubebuider create api [options] --plugins=declarative/v1`. |
133+
| Field | Description |
134+
|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
135+
| `layout` | Defines the global plugins, e.g. a project `init` with `--plugins="go/v4,deploy-image/v1-alpha"` means that any sub-command used will always call its implementation for both plugins in a chain. |
136+
| `domain` | Store the domain of the project. This information can be provided by the user when the project is generate with the `init` sub-command and the `domain` flag. |
137+
| `plugins` | Defines the plugins used to do custom scaffolding, e.g. to use the optional `deploy-image/v1-alpha` plugin to do scaffolding for just a specific api via the command `kubebuider create api [options] --plugins=deploy-image/v1-alpha`. |
138138
| `projectName` | The name of the project. This will be used to scaffold the manager data. By default it is the name of the project directory, however, it can be provided by the user in the `init` sub-command via the `--project-name` flag. |
139-
| `repo` | The project repository which is the Golang module, e.g `github.com/example/myproject-operator`. |
140-
| `resources` | An array of all resources which were scaffolded in the project. |
141-
| `resources.api` | The API scaffolded in the project via the sub-command `create api`. |
142-
| `resources.api.crdVersion` | The Kubernetes API version (`apiVersion`) used to do the scaffolding for the CRD resource. |
143-
| `resources.api.namespaced` | The API RBAC permissions which can be namespaced or cluster scoped. |
144-
| `resources.controller` | Indicates whether a controller was scaffolded for the API. |
145-
| `resources.domain` | The domain of the resource which is provided by the `--domain` flag when the sub-command `create api` is used. |
146-
| `resources.group` | The GKV group of the resource which is provided by the `--group` flag when the sub-command `create api` is used. |
147-
| `resources.version` | The GKV version of the resource which is provided by the `--version` flag when the sub-command `create api` is used. |
148-
| `resources.kind` | Store GKV Kind of the resource which is provided by the `--kind` flag when the sub-command `create api` is used. |
149-
| `resources.path` | The import path for the API resource. It will be `<repo>/api/<kind>` unless the API added to the project is an external or core-type. For the core-types scenarios, the paths used are mapped [here][core-types]. |
150-
| `resources.webhooks`| Store the webhooks data when the sub-command `create webhook` is used. |
151-
| `resources.webhooks.webhookVersion` | The Kubernetes API version (`apiVersion`) used to scaffold the webhook resource. |
152-
| `resources.webhooks.conversion` | It is `true` when the webhook was scaffold with the `--conversion` flag which means that is a conversion webhook. |
153-
| `resources.webhooks.defaulting` | It is `true` when the webhook was scaffold with the `--defaulting` flag which means that is a defaulting webhook. |
154-
| `resources.webhooks.validation` | It is `true` when the webhook was scaffold with the `--programmatic-validation` flag which means that is a validation webhook. |
139+
| `repo` | The project repository which is the Golang module, e.g `github.com/example/myproject-operator`. |
140+
| `resources` | An array of all resources which were scaffolded in the project. |
141+
| `resources.api` | The API scaffolded in the project via the sub-command `create api`. |
142+
| `resources.api.crdVersion` | The Kubernetes API version (`apiVersion`) used to do the scaffolding for the CRD resource. |
143+
| `resources.api.namespaced` | The API RBAC permissions which can be namespaced or cluster scoped. |
144+
| `resources.controller` | Indicates whether a controller was scaffolded for the API. |
145+
| `resources.domain` | The domain of the resource which is provided by the `--domain` flag when the sub-command `create api` is used. |
146+
| `resources.group` | The GKV group of the resource which is provided by the `--group` flag when the sub-command `create api` is used. |
147+
| `resources.version` | The GKV version of the resource which is provided by the `--version` flag when the sub-command `create api` is used. |
148+
| `resources.kind` | Store GKV Kind of the resource which is provided by the `--kind` flag when the sub-command `create api` is used. |
149+
| `resources.path` | The import path for the API resource. It will be `<repo>/api/<kind>` unless the API added to the project is an external or core-type. For the core-types scenarios, the paths used are mapped [here][core-types]. |
150+
| `resources.webhooks`| Store the webhooks data when the sub-command `create webhook` is used. |
151+
| `resources.webhooks.webhookVersion` | The Kubernetes API version (`apiVersion`) used to scaffold the webhook resource. |
152+
| `resources.webhooks.conversion` | It is `true` when the webhook was scaffold with the `--conversion` flag which means that is a conversion webhook. |
153+
| `resources.webhooks.defaulting` | It is `true` when the webhook was scaffold with the `--defaulting` flag which means that is a defaulting webhook. |
154+
| `resources.webhooks.validation` | It is `true` when the webhook was scaffold with the `--programmatic-validation` flag which means that is a validation webhook. |
155155

156156
[project]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/testdata/project-v3/PROJECT
157157
[versioning]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/VERSIONING.md#Versioning

test/e2e/deployimage/plugin_cluster_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var _ = Describe("kubebuilder", func() {
7575
It("should generate a runnable project with deploy-image/v1-alpha options ", func() {
7676
var err error
7777

78-
By("initializing a project with go/v3")
78+
By("initializing a project with go/v4")
7979
err = kbc.Init(
8080
"--plugins", "go/v4",
8181
"--project-version", "3",

0 commit comments

Comments
 (0)