mirror of
https://github.com/openshift/installer.git
synced 2026-02-06 00:48:45 +01:00
Merge pull request #715 from wking/drop-deprecated-commands
cmd/openshift-install: Remove deprecated commands
This commit is contained in:
@@ -2,7 +2,6 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -102,18 +101,6 @@ var (
|
||||
targets = []target{installConfigTarget, manifestTemplatesTarget, manifestsTarget, ignitionConfigsTarget, clusterTarget}
|
||||
)
|
||||
|
||||
// Deprecated: Use 'create' subcommands instead.
|
||||
func newTargetsCmd() []*cobra.Command {
|
||||
var cmds []*cobra.Command
|
||||
for _, t := range targets {
|
||||
cmd := *t.command
|
||||
cmd.Short = fmt.Sprintf("DEPRECATED: USE 'create %s' instead.", cmd.Use)
|
||||
cmd.RunE = runTargetCmd(t.assets...)
|
||||
cmds = append(cmds, &cmd)
|
||||
}
|
||||
return cmds
|
||||
}
|
||||
|
||||
func newCreateCmd() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "create",
|
||||
|
||||
@@ -26,14 +26,6 @@ func newDestroyCmd() *cobra.Command {
|
||||
return cmd
|
||||
}
|
||||
|
||||
func newLegacyDestroyClusterCmd() *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "destroy-cluster",
|
||||
Short: "DEPRECATED: Use 'destroy cluster' instead.",
|
||||
RunE: runDestroyCmd,
|
||||
}
|
||||
}
|
||||
|
||||
func newDestroyClusterCmd() *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "cluster",
|
||||
|
||||
@@ -20,14 +20,9 @@ var (
|
||||
func main() {
|
||||
rootCmd := newRootCmd()
|
||||
|
||||
for _, cmd := range newTargetsCmd() {
|
||||
rootCmd.AddCommand(cmd)
|
||||
}
|
||||
|
||||
for _, subCmd := range []*cobra.Command{
|
||||
newCreateCmd(),
|
||||
newDestroyCmd(),
|
||||
newLegacyDestroyClusterCmd(),
|
||||
newVersionCmd(),
|
||||
newGraphCmd(),
|
||||
} {
|
||||
|
||||
Reference in New Issue
Block a user