Skip to content

Commit

Permalink
Modify "deleteClusterfile" to "specifyClusterfile"
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevent-fei committed Nov 2, 2022
1 parent fbb0102 commit 8dd9f84
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cmd/sealer/cmd/cluster/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ import (
)

var (
deleteFlags *types.Flags
deleteClusterFile string
deleteAll bool
ForceDelete bool
deleteFlags *types.Flags
specifyClusterfile string
deleteAll bool
ForceDelete bool
)

var longDeleteCmdDescription = `delete command is used to delete part or all of existing cluster.
Expand Down Expand Up @@ -70,11 +70,11 @@ func NewDeleteCmd() *cobra.Command {
workersToDelete = deleteFlags.Nodes
)
workClusterfile := common.GetDefaultClusterfile()
if mastersToDelete == "" && workersToDelete == "" && !deleteAll && deleteClusterFile == "" {
if mastersToDelete == "" && workersToDelete == "" && !deleteAll {
return fmt.Errorf("you must input node ip Or set flag -a")
}
if deleteClusterFile != "" {
return deleteCluster(deleteClusterFile)
if specifyClusterfile != "" {
workClusterfile = specifyClusterfile
}
if deleteAll {
return deleteCluster(workClusterfile)
Expand All @@ -86,7 +86,7 @@ func NewDeleteCmd() *cobra.Command {
deleteFlags = &types.Flags{}
deleteCmd.Flags().StringVarP(&deleteFlags.Masters, "masters", "m", "", "reduce Count or IPList to masters")
deleteCmd.Flags().StringVarP(&deleteFlags.Nodes, "nodes", "n", "", "reduce Count or IPList to nodes")
deleteCmd.Flags().StringVarP(&deleteClusterFile, "Clusterfile", "f", "", "delete a kubernetes cluster with Clusterfile")
deleteCmd.Flags().StringVarP(&specifyClusterfile, "Clusterfile", "f", "", "delete a kubernetes cluster with Clusterfile")
deleteCmd.Flags().StringSliceVarP(&deleteFlags.CustomEnv, "env", "e", []string{}, "set custom environment variables")
deleteCmd.Flags().BoolVar(&ForceDelete, "force", false, "We also can input an --force flag to delete cluster by force")
deleteCmd.Flags().BoolVarP(&deleteAll, "all", "a", false, "this flags is for delete the entire cluster, default is false")
Expand Down

0 comments on commit 8dd9f84

Please sign in to comment.