Skip to content

Commit

Permalink
Remove operator-sdk new|add api commands and ansible scaffolding.
Browse files Browse the repository at this point in the history
This commit does the following:
1. Remove operator-sdk new  and operator-sdk add api in favour of ansible plugins.
2. Remove ansible scaffolding (ie) internal/scaffold/ansible.
3. Remove internal/flags/apiflags/flags.go  and relevant tests which were used in the commands.
4. Update IsOperatorAnsible() to check only for new layouts.
5. Remove hack/tests/e2e-ansible-molecule.sh and rewrite hack/tests/e2e-ansible.sh (which will get updated after ansible plugins).
  • Loading branch information
varshaprasad96 committed Jul 25, 2020
1 parent b999502 commit 04658a8
Show file tree
Hide file tree
Showing 50 changed files with 47 additions and 2,868 deletions.
33 changes: 33 additions & 0 deletions changelog/fragments/rm-cmd-legacy-ansible.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
The commands `operator-sdk new --type=ansible` and `operator-sdk add api` are no longer supported for Ansible-based Operators.
# kind is one of:
# - addition
# - change
# - deprecation
# - removal
# - bugfix
kind: "removal"
# Is this a breaking change?
breaking: true
# NOTE: ONLY USE `pull_request_override` WHEN ADDING THIS
# FILE FOR A PREVIOUSLY MERGED PULL_REQUEST!
#
# The generator auto-detects the PR number from the commit
# message in which this file was originally added.
#
# What is the pull request number (without the "#")?
# pull_request_override: 0
# Migration can be defined to automatically add a section to
# the migration guide. This is required for breaking changes.
migration:
header: New and api subcommands are no longer supported for Ansible-based Operators.
body: >
TBD
162 changes: 0 additions & 162 deletions cmd/operator-sdk/add/api.go

This file was deleted.

1 change: 0 additions & 1 deletion cmd/operator-sdk/add/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ func NewCmd() *cobra.Command {
Long: "",
}

cmd.AddCommand(newAddAPICmd())
cmd.AddCommand(newAddCRDCmd())
return cmd
}
4 changes: 0 additions & 4 deletions cmd/operator-sdk/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/operator-framework/operator-sdk/cmd/operator-sdk/cleanup"
"github.com/operator-framework/operator-sdk/cmd/operator-sdk/completion"
"github.com/operator-framework/operator-sdk/cmd/operator-sdk/generate"
"github.com/operator-framework/operator-sdk/cmd/operator-sdk/new"
"github.com/operator-framework/operator-sdk/cmd/operator-sdk/olm"
"github.com/operator-framework/operator-sdk/cmd/operator-sdk/run"
"github.com/operator-framework/operator-sdk/cmd/operator-sdk/scorecard"
Expand All @@ -38,9 +37,6 @@ import (
)

var commands = []*cobra.Command{
// The "new" cmd provides a way to scaffold Helm/Ansible projects
// from the new CLI.
new.NewCmd(),
scorecard.NewCmd(),
build.NewCmd(),
bundle.NewCmd(),
Expand Down
5 changes: 0 additions & 5 deletions cmd/operator-sdk/cli/legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/operator-framework/operator-sdk/cmd/operator-sdk/add"
"github.com/operator-framework/operator-sdk/cmd/operator-sdk/build"
"github.com/operator-framework/operator-sdk/cmd/operator-sdk/completion"
"github.com/operator-framework/operator-sdk/cmd/operator-sdk/new"
"github.com/operator-framework/operator-sdk/cmd/operator-sdk/olm"
"github.com/operator-framework/operator-sdk/cmd/operator-sdk/scorecard"
"github.com/operator-framework/operator-sdk/cmd/operator-sdk/version"
Expand Down Expand Up @@ -61,11 +59,9 @@ func GetCLIRoot() *cobra.Command {
}

root.AddCommand(
add.NewCmd(),
build.NewCmd(),
scorecard.NewCmd(),
completion.NewCmd(),
new.NewCmd(),
olm.NewCmd(),
version.NewCmd(),
)
Expand Down Expand Up @@ -95,7 +91,6 @@ func checkGoModulesForCmd(cmd *cobra.Command) (err error) {
}

var commandsToSkip = map[string]struct{}{
"new": struct{}{}, // Handles this logic in cmd/operator-sdk/new
"operator-sdk": struct{}{}, // Alias for "help"
"help": struct{}{},
"completion": struct{}{},
Expand Down
1 change: 0 additions & 1 deletion cmd/operator-sdk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ func main() {
}

// Run the KB CLI when not running in either legacy or new projects
// The new CLI still supports "operator-sdk new --type=Ansible/Helm"
if err := cli.Run(); err != nil {
log.Fatal(err)
}
Expand Down
Loading

0 comments on commit 04658a8

Please sign in to comment.