Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy generate and bundle commands #3414

Merged
merged 2 commits into from
Jul 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions changelog/fragments/rm-legacy-bundle-cmds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
Remove legacy "bundle create/validate" commands
kind: "removal"
# Is this a breaking change?
breaking: true
migration:
header: Remove legacy "bundle create/validate" commands
body: TBD
11 changes: 11 additions & 0 deletions changelog/fragments/rm-legacy-gen-bundle.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
Remove legacy generate bundle command
kind: "removal"
# Is this a breaking change?
breaking: true
migration:
header: Remove legacy generate bundle command
body: TBD
11 changes: 11 additions & 0 deletions changelog/fragments/rm-legacy-gen-csv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
Remove legacy generate csv command
kind: "removal"
# Is this a breaking change?
breaking: true
migration:
header: Remove legacy generate csv command
body: TBD
11 changes: 11 additions & 0 deletions changelog/fragments/rm-legacy-gen-packagemanifests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
Remove legacy generate packagemanifests command
kind: "removal"
# Is this a breaking change?
breaking: true
migration:
header: Remove legacy generate packagemanifests command
body: TBD
35 changes: 6 additions & 29 deletions cmd/operator-sdk/bundle/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,11 @@ import (

//nolint:structcheck
type bundleCmd struct {
directory string
packageName string
imageTag string
imageBuilder string
defaultChannel string
channels string
generateOnly bool
directory string
imageBuilder string
}

func newCmd() *cobra.Command {
func NewCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "bundle",
Short: "Manage operator bundle metadata",
Expand All @@ -39,30 +34,12 @@ native software, like the Operator Lifecycle Manager.

More information about operator bundles and metadata:
https://github.com/operator-framework/operator-registry/blob/master/docs/design/operator-bundle.md
`,
}
return cmd
}

func NewCmdLegacy() *cobra.Command {
cmd := newCmd()
cmd.Long += `
More information about the integration with OLM via SDK:
https://sdk.operatorframework.io/docs/olm-integration/legacy
`
cmd.AddCommand(
newCreateCmd(),
newValidateCmdLegacy(),
)
return cmd
}

func NewCmd() *cobra.Command {
cmd := newCmd()
cmd.Long += `
More information about the integration with OLM via SDK:
https://sdk.operatorframework.io/docs/olm-integration
`
`,
}

cmd.AddCommand(
newValidateCmd(),
)
Expand Down
12 changes: 0 additions & 12 deletions cmd/operator-sdk/bundle/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,4 @@ var _ = Describe("Running a bundle command", func() {
Expect(subcommands[0].Use).To(Equal("validate"))
})
})

Describe("NewCmdLegacy", func() {
It("builds and returns a cobra command with the correct subcommands", func() {
cmd := NewCmdLegacy()
Expect(cmd).NotTo(BeNil())

subcommands := cmd.Commands()
Expect(len(subcommands)).To(Equal(2))
Expect(subcommands[0].Use).To(Equal("create"))
Expect(subcommands[1].Use).To(Equal("validate"))
})
})
})
Loading