Skip to content

Commit

Permalink
remove declarative plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
camilamacedo86 committed May 17, 2024
1 parent 9bdb9a8 commit 793e5e4
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 908 deletions.
2 changes: 0 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang"

//nolint:staticcheck
declarativev1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/declarative/v1"
deployimagev1alpha1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/deploy-image/v1alpha1"
golangv4 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v4"
grafanav1alpha1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/optional/grafana/v1alpha"
Expand Down Expand Up @@ -60,7 +59,6 @@ func main() {
golangv4.Plugin{},
gov4Bundle,
&kustomizecommonv2.Plugin{},
&declarativev1.Plugin{},
&deployimagev1alpha1.Plugin{},
&grafanav1alpha1.Plugin{},
),
Expand Down
1 change: 0 additions & 1 deletion docs/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
- [To scaffold a project](./plugins/to-scaffold-project.md)
- [go/v4 (Default init scaffold)](./plugins/go-v4-plugin.md)
- [To add optional features](./plugins/to-add-optional-features.md)
- [declarative/v1 (Deprecated)](./plugins/declarative-v1.md)
- [grafana/v1-alpha](./plugins/grafana-v1-alpha.md)
- [deploy-image/v1-alpha](./plugins/deploy-image-plugin-v1-alpha.md)
- [To be extended for others tools](./plugins/to-be-extended.md)
Expand Down
77 changes: 0 additions & 77 deletions docs/book/src/plugins/declarative-v1.md

This file was deleted.

6 changes: 3 additions & 3 deletions docs/book/src/plugins/extending-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"sigs.k8s.io/kubebuilder/v3/pkg/plugin"
kustomizecommonv2 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v2"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang"
declarativev1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/declarative/v1"
golangv4 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v4"
deployimage "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/deploy-image/v1alpha1"
golangv4 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v4"

)

Expand Down Expand Up @@ -58,7 +58,7 @@ func GetPluginsCLI() (*cli.CLI) {
// Register the plugins options which can be used to do the scaffolds via your CLI tool. See that we are using as example here the plugins which are implemented and provided by Kubebuilder
cli.WithPlugins(
gov3Bundle,
&declarativev1.Plugin{},
&deployimage.Plugin{},
),

// Defines what will be the default plugin used by your binary. It means that will be the plugin used if no info be provided such as when the user runs `kubebuilder init`
Expand Down
1 change: 0 additions & 1 deletion docs/book/src/plugins/to-add-optional-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ The following plugins are useful to generate code and take advantage of optional

| Plugin | Key | Description |
|-------------------------------------------------------------------------| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [declarative.go.kubebuilder.io/v1 - (Deprecated) ](declarative-v1.md) | `declarative/v1` | Optional plugin used to scaffold APIs/controllers using the [kubebuilder-declarative-pattern][kubebuilder-declarative-pattern] project. |
| [grafana.kubebuilder.io/v1-alpha](grafana-v1-alpha.md) | `grafana/v1-alpha` | Optional helper plugin which can be used to scaffold Grafana Manifests Dashboards for the default metrics which are exported by controller-runtime. |
| [deploy-image.go.kubebuilder.io/v1-alpha](deploy-image-plugin-v1-alpha) | `deploy-image/v1-alpha` | Optional helper plugin which can be used to scaffold APIs and controller with code implementation to Deploy and Manage an Operand(image). |
1 change: 0 additions & 1 deletion docs/book/src/plugins/to-be-extended.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ helpers on top, such as [Operator-SDK][sdk] does to add their features to integr
| `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`) |

[create-plugins]: creating-plugins.md
[kubebuilder-declarative-pattern]: https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern
[kustomize]: https://kustomize.io/
[sdk]: https://github.com/operator-framework/operator-sdk
[olm]: https://olm.operatorframework.io/
Expand Down
44 changes: 32 additions & 12 deletions docs/book/src/reference/project-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,30 +82,50 @@ The `PROJECT` version `3` layout looks like:
```yaml
domain: testproject.org
layout:
- go.kubebuilder.io/v3
- go.kubebuilder.io/v4
plugins:
declarative.go.kubebuilder.io/v1:
deploy-image.go.kubebuilder.io/v1-alpha:
resources:
- domain: testproject.org
group: crew
kind: FirstMate
version: v1
projectName: example
repo: sigs.k8s.io/kubebuilder/example
group: example.com
kind: Memcached
options:
containerCommand: memcached,-m=64,-o,modern,-v
containerPort: "11211"
image: memcached:memcached:1.6.26-alpine3.19
runAsUser: "1001"
version: v1alpha1
- domain: testproject.org
group: example.com
kind: Busybox
options:
image: busybox:1.36.1
version: v1alpha1
projectName: project-v4-with-deploy-image
repo: sigs.k8s.io/kubebuilder/testdata/project-v4-with-deploy-image
resources:
- api:
crdVersion: v1
namespaced: true
controller: true
domain: testproject.org
group: crew
kind: Captain
path: sigs.k8s.io/kubebuilder/example/api/v1
version: v1
group: example.com
kind: Memcached
path: sigs.k8s.io/kubebuilder/testdata/project-v4-with-deploy-image/api/v1alpha1
version: v1alpha1
webhooks:
defaulting: true
validation: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: testproject.org
group: example.com
kind: Busybox
path: sigs.k8s.io/kubebuilder/testdata/project-v4-with-deploy-image/api/v1alpha1
version: v1alpha1
version: "3"
```

Now let's check its layout fields definition:
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ plugins:

When("having multiple plugins in the layout field", func() {
It("should succeed", func() {
pluginChain := []string{"go.kubebuilder.io/v2", "declarative.kubebuilder.io/v1"}
pluginChain := []string{"go.kubebuilder.io/v2", "deploy-image.go.kubebuilder.io/v1-alpha"}

projectConfig := cfgv3.New()
Expect(projectConfig.SetPluginChain(pluginChain)).To(Succeed())
Expand Down
136 changes: 0 additions & 136 deletions pkg/plugins/golang/declarative/v1/api.go

This file was deleted.

Loading

0 comments on commit 793e5e4

Please sign in to comment.