Skip to content

Commit

Permalink
⚠️ adds deprecation of declarative plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
camilamacedo86 committed Aug 26, 2023
1 parent 226f160 commit 70d3f3c
Show file tree
Hide file tree
Showing 64 changed files with 38 additions and 2,580 deletions.
16 changes: 15 additions & 1 deletion docs/book/src/plugins/declarative-v1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
# Declarative Plugin
# [Deprecated] Declarative Plugin

<aside class="note warning">
<h1>Notice of Deprecation</h1>

The Declarative plugin is an implementation derived from the [kubebuilder-declarative-pattern][kubebuilder-declarative-pattern] project.
As the project maintainers possess the most comprehensive knowledge about its changes and Kubebuilder allows
the creation of custom plugins using its library, it has been decided that this plugin will be better
maintained within the [kubebuilder-declarative-pattern][kubebuilder-declarative-pattern] project itself,
which falls under its domain of responsibility. This decision aims to improve the maintainability of both the
plugin and Kubebuilder, ultimately providing an enhanced user experience. To follow up on this work, please refer
to [Issue #293](https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/issues/293) in the
kubebuilder-declarative-pattern repository.

</aside>

The declarative plugin allows you to create [controllers][controller-runtime] using the [kubebuilder-declarative-pattern][kubebuilder-declarative-pattern].
By using the declarative plugin, you can make the required changes on top of what is scaffolded by default when you create a Go project with Kubebuilder and the Golang plugins (i.e. go/v2, go/v3).
Expand Down
10 changes: 5 additions & 5 deletions docs/book/src/plugins/to-add-optional-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

The following plugins are useful to generate code and take advantage of optional features

| Plugin | Key | Description |
| ---------------------------------------------------------------------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [declarative.go.kubebuilder.io/v1](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). |
| 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). |
19 changes: 18 additions & 1 deletion pkg/plugins/golang/declarative/v1/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Deprecated: The declarative plugin has been deprecated.
// The Declarative plugin is an implementation derived from the kubebuilder-declarative-pattern project.
// As the project maintainers possess the most comprehensive knowledge about its changes and Kubebuilder
// allows the creation of custom plugins using its library, it has been decided that this plugin will be
// better maintained within the kubebuilder-declarative-pattern project
// itself, which falls under its domain of responsibility. This decision aims to improve the maintainability
// of both the plugin and Kubebuilder, ultimately providing an enhanced user experience.
// To follow up on this work, please refer to the Issue #293:
// https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/issues/293.
package v1

import (
Expand Down Expand Up @@ -61,5 +70,13 @@ type pluginConfig struct {
}

func (p Plugin) DeprecationWarning() string {
return ""
return "The declarative plugin has been deprecated. \n" +
"The Declarative plugin is an implementation derived from the kubebuilder-declarative-pattern project. " +
"As the project maintainers possess the most comprehensive knowledge about its changes and Kubebuilder " +
"allows the creation of custom plugins using its library, it has been decided that this plugin will be " +
"better maintained within the kubebuilder-declarative-pattern project " +
"itself, which falls under its domain of responsibility. This decision aims to improve the maintainability " +
"of both the plugin and Kubebuilder, ultimately providing an enhanced user experience." +
"To follow up on this work, please refer to the Issue #293: " +
"https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/issues/293."
}
6 changes: 0 additions & 6 deletions test/testdata/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,6 @@ function scaffold_test_project {
$kb create api --version v1 --kind Lakers --controller=true --resource=true --make=false
$kb create webhook --version v1 --kind Lakers --defaulting --programmatic-validation
fi
elif [[ $project =~ declarative ]]; then
header_text 'Creating APIs ...'
$kb create api --group crew --version v1 --kind Captain --controller=true --resource=true --make=false
$kb create api --group crew --version v1 --kind FirstMate --controller=true --resource=true --make=false
$kb create api --group crew --version v1 --kind Admiral --controller=true --resource=true --namespaced=false --make=false
elif [[ $project =~ deploy-image ]]; then
header_text 'Creating Memcached API with deploy-image plugin ...'
$kb create api --group example.com --version v1alpha1 --kind Memcached --image=memcached:1.4.36-alpine --image-container-command="memcached,-m=64,-o,modern,-v" --image-container-port="11211" --run-as-user="1001" --plugins="deploy-image/v1-alpha" --make=false
Expand Down Expand Up @@ -135,6 +130,5 @@ scaffold_test_project project-v3 --plugins="go/v3"
# [Currently, default CLI plugin] - [Next version, alpha] Project version v4-alpha
scaffold_test_project project-v4 --plugins="go/v4"
scaffold_test_project project-v4-multigroup --plugins="go/v4"
scaffold_test_project project-v4-declarative-v1 --plugins="go/v4,declarative"
scaffold_test_project project-v4-with-deploy-image --plugins="go/v4"
scaffold_test_project project-v4-with-grafana --plugins="go/v4"
1 change: 0 additions & 1 deletion test/testdata/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,5 @@ build_kb
# Project version v4-alpha
test_project project-v4
test_project project-v4-multigroup
test_project project-v4-declarative-v1
test_project project-v4-with-deploy-image
test_project project-v4-with-grafana
3 changes: 0 additions & 3 deletions testdata/project-v4-declarative-v1/.dockerignore

This file was deleted.

26 changes: 0 additions & 26 deletions testdata/project-v4-declarative-v1/.gitignore

This file was deleted.

40 changes: 0 additions & 40 deletions testdata/project-v4-declarative-v1/Dockerfile

This file was deleted.

53 changes: 0 additions & 53 deletions testdata/project-v4-declarative-v1/PROJECT

This file was deleted.

94 changes: 0 additions & 94 deletions testdata/project-v4-declarative-v1/README.md

This file was deleted.

Loading

0 comments on commit 70d3f3c

Please sign in to comment.