Skip to content

Commit

Permalink
*: make go/v3 the default plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
estroz committed Dec 12, 2020
1 parent 71ec07f commit 29cbd64
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
13 changes: 13 additions & 0 deletions changelog/fragments/go-v3-default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
entries:
- description: >
Go CLI plugin go/v3 is now the default.
kind: change
breaking: false
migration:
header: Upgrade your Go project from "go.kubebuilder.io/v2" to "go.kubebuilder.io/v3"
body: >
The newly released go/v3 plugin has many new features and (breaking) changes
incompatible with projects created by go/v2. You are not required to upgrade
and your project will continue to work with new operator-sdk versions.
If you wish to upgrade, check out the upstream
[migration guide](https://master.book.kubebuilder.io/migration/plugin/plugins.html).
3 changes: 1 addition & 2 deletions internal/cmd/operator-sdk/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ func GetPluginsCLIAndRoot() (cli.CLI, *cobra.Command) {
&ansiblev1.Plugin{},
),
cli.WithDefaultPlugins(config.Version2, &golangv2.Plugin{}),
// TODO(estroz): make go/v3-alpha plugin the default once stabilized.
cli.WithDefaultPlugins(config.Version3Alpha, &golangv2.Plugin{}),
cli.WithDefaultPlugins(config.Version3Alpha, &golangv3.Plugin{}),
cli.WithExtraCommands(commands...),
)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions test/e2e-go/e2e_go_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ var _ = BeforeSuite(func() {
tc.Kubectl.Namespace = fmt.Sprintf("%s-system", tc.ProjectName)

By("copying sample to a temporary e2e directory")
Expect(exec.Command("cp", "-r", "../../testdata/go/v2/memcached-operator", tc.Dir).Run()).To(Succeed())
Expect(exec.Command("cp", "-r", "../../testdata/go/v3/memcached-operator", tc.Dir).Run()).To(Succeed())

By("fetching the current-context")
tc.Kubectx, err = tc.Kubectl.Command("config", "current-context")
Expand Down Expand Up @@ -98,14 +98,14 @@ var _ = BeforeSuite(func() {
}

By("installing cert manager bundle")
Expect(tc.InstallCertManager(true)).To(Succeed())
Expect(tc.InstallCertManager(false)).To(Succeed())
})

// AfterSuite run after all the specs have run, regardless of whether any tests have failed to ensures that
// all be cleaned up
var _ = AfterSuite(func() {
By("uninstall cert manager bundle")
tc.UninstallCertManager(true)
tc.UninstallCertManager(false)

By("uninstalling prerequisites")
tc.UninstallPrerequisites()
Expand Down
1 change: 1 addition & 0 deletions website/content/en/docs/cli/operator-sdk_init.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ operator-sdk init [flags]
### Options

```
--component-config create a versioned ComponentConfig file, may be 'true' or 'false'
--domain string domain for groups (default "my.domain")
--fetch-deps ensure dependencies are downloaded (default true)
-h, --help help for init
Expand Down

0 comments on commit 29cbd64

Please sign in to comment.