Skip to content

Commit

Permalink
Remove legacy generate and bundle commands (#3414)
Browse files Browse the repository at this point in the history
Removed legacy "generate csv/packagemanifests/bundle", and "bundle create/validate" commands.
Also removed associated scaffolding packages for these commands in "internal/generate/olm-catalog".
  • Loading branch information
hasbro17 authored Jul 17, 2020
1 parent 9defce6 commit 76b641d
Show file tree
Hide file tree
Showing 26 changed files with 141 additions and 2,931 deletions.
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

0 comments on commit 76b641d

Please sign in to comment.