Skip to content

Commit

Permalink
⚠️ officially deprecate go/v2 plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Camila Macedo committed Jun 16, 2022
1 parent 0dbbf57 commit 6ae4507
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 4 deletions.
28 changes: 24 additions & 4 deletions docs/book/src/plugins/go-v2-plugin.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
# go/v2 (go.kubebuilder.io/v2)
# go/v2 (go.kubebuilder.io/v2 - "Kubebuilder 2.x" layout)

The `go/v2` plugin has the purpose to scaffold Golang projects to help users to build projects with [controllers][controller-runtime] and keep the backwards compatibility with the default scaffold made using Kubebuilder CLI `2.x.z` releases.
<aside class="note warning">
<h1>Deprecated</h1>

The `go/v2` plugin cannot scaffold solutions which uses CRD and/or Webhooks with the v1 version and properly
work with the plugins ecosystem introduced with Kubebuilder `3.0.0`[More info](plugins.md). Note that `v1beta1` was deprecated on Kubernetes `1.16` and no longer is offered since its release `1.22`.
Therefore, this plugin was kept to ensure the backwords compability with old Kubebuilder versions
scaffolds produced with `"Kubebuilder 2.x"` layout.

Since `28 Apr 2021`, the default layout produced by Kubebuilder changed and is done via the `go/v3`.
We encourage you migrate your project to the latest version if your project was built with a Kubebuilder
versions < `3.0.0`.

<node>
The recommended way to migrate a `v2` project is to create a new `v3` project and copy over the API
and the reconciliation code. The conversion will end up with a project that looks like a native `v3` project.
For further information check the [Migration guide](./../migration/manually_migration_guide_v2_v3.md)

</aside>

The `go/v2` plugin has the purpose to scaffold Golang projects to help users
to build projects with [controllers][controller-runtime] and keep the backwards compatibility
with the default scaffold made using Kubebuilder CLI `2.x.z` releases.

<aside class="note">

You can check samples using this plugin by looking at the `project-v2-<options>` directories under the [testdata][testdata] projects on the root directory of the Kubebuilder project.

</node>
</aside>

## When should I use this plugin ?

Expand Down
1 change: 1 addition & 0 deletions pkg/config/v2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

//go:deprecated This package has been deprecated
package v2

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/config/v2/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

//go:deprecated This package has been deprecated
package v2

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/plugins/golang/v2/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

//go:deprecated This package has been deprecated
package v2

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/plugins/golang/v2/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

//go:deprecated This package has been deprecated
package v2

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/plugins/golang/v2/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

//go:deprecated This package has been deprecated
package v2

import (
Expand Down
9 changes: 9 additions & 0 deletions pkg/plugins/golang/v2/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

//go:deprecated This package has been deprecated
package v2

import (
Expand Down Expand Up @@ -63,3 +64,11 @@ func (p Plugin) GetCreateWebhookSubcommand() plugin.CreateWebhookSubcommand {

// GetEditSubcommand will return the subcommand which is responsible for editing the scaffold of the project
func (p Plugin) GetEditSubcommand() plugin.EditSubcommand { return &p.editSubcommand }

func (p Plugin) DeprecationWarning() string {
return "This version is deprecated and is no longer scaffolded by default since `28 Apr 2021`." +
"The `go/v2` plugin cannot scaffold solutions which uses CRD and/or Webhooks with the v1 version." +
"Be aware that v1beta1 API for CRDs and Webhooks were deprecated on Kubernetes 1.16 and are" +
"no longer offered since its 1.22 release. Therefore, it is recommended upgrade your project " +
"to the latest versions."
}
1 change: 1 addition & 0 deletions pkg/plugins/golang/v2/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

//go:deprecated This package has been deprecated
package v2

import (
Expand Down
1 change: 1 addition & 0 deletions test/e2e/v2/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

//go:deprecated This package has been deprecated
package v2

import (
Expand Down
1 change: 1 addition & 0 deletions test/e2e/v2/plugin_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

//go:deprecated This package has been deprecated
package v2

import (
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/v3/plugin_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ var _ = Describe("kubebuilder", func() {
kbc.Destroy()
})

//TODO: remove me when the plugin go/v2 be removed
//go:deprecated this plugin is deprecated
Context("plugin go.kubebuilder.io/v2", func() {
// Use cert-manager with v1beta2 CRs.
BeforeEach(func() {
Expand Down

0 comments on commit 6ae4507

Please sign in to comment.