@@ -172,10 +172,7 @@ func createClusterCommand() *cobra.Command {
172172 Run : func (cmd * cobra.Command , args []string ) {
173173 operatorEndpoint , err := cmd .Flags ().GetString ("operator-endpoint" )
174174 if err != nil {
175- operatorEndpoint , err = getOperatorEndpoint ()
176- if err != nil {
177- cmdFailedf (cmd , "get operator endpoint failed: %s" , err )
178- }
175+ cmdFailedf (cmd , "get operator endpoint failed: %s" , err )
179176 }
180177
181178 if showInstallableList {
@@ -251,6 +248,7 @@ func createClusterCommand() *cobra.Command {
251248 }
252249
253250 clusterspec := table .NewWriter ()
251+ clusterspec .SetCaption ("The Endpoints Of Vanus Operator: %s\n " , operatorEndpoint )
254252 clusterspec .AppendHeader (table.Row {"Cluster" , "Version" , "Component" , "Replicas" , "StorageSize" , "StorageClass" })
255253 if c .Etcd .StorageClass == nil {
256254 clusterspec .AppendRow (table.Row {"vanus" , * c .Version , "etcd" , * c .Etcd .Replicas , * c .Etcd .StorageSize , "-" })
@@ -353,10 +351,7 @@ func deleteClusterCommand() *cobra.Command {
353351 Run : func (cmd * cobra.Command , args []string ) {
354352 operatorEndpoint , err := cmd .Flags ().GetString ("operator-endpoint" )
355353 if err != nil {
356- operatorEndpoint , err = getOperatorEndpoint ()
357- if err != nil {
358- cmdFailedf (cmd , "get operator endpoint failed: %s" , err )
359- }
354+ cmdFailedf (cmd , "get operator endpoint failed: %s" , err )
360355 }
361356
362357 fmt .Print ("Deleting a cluster will lose all cluster data and can't be recovered, do you still want to delete the vanus cluster(y/n):" )
@@ -467,10 +462,7 @@ func upgradeClusterCommand() *cobra.Command {
467462 Run : func (cmd * cobra.Command , args []string ) {
468463 operatorEndpoint , err := cmd .Flags ().GetString ("operator-endpoint" )
469464 if err != nil {
470- operatorEndpoint , err = getOperatorEndpoint ()
471- if err != nil {
472- cmdFailedf (cmd , "get operator endpoint failed: %s" , err )
473- }
465+ cmdFailedf (cmd , "get operator endpoint failed: %s" , err )
474466 }
475467
476468 if showUpgradeableList {
@@ -590,10 +582,7 @@ func scaleStoreReplicas() *cobra.Command {
590582 Run : func (cmd * cobra.Command , args []string ) {
591583 operatorEndpoint , err := cmd .Flags ().GetString ("operator-endpoint" )
592584 if err != nil {
593- operatorEndpoint , err = getOperatorEndpoint ()
594- if err != nil {
595- cmdFailedf (cmd , "get operator endpoint failed: %s" , err )
596- }
585+ cmdFailedf (cmd , "get operator endpoint failed: %s" , err )
597586 }
598587
599588 client := & http.Client {}
@@ -662,10 +651,7 @@ func scaleTriggerReplicas() *cobra.Command {
662651 Run : func (cmd * cobra.Command , args []string ) {
663652 operatorEndpoint , err := cmd .Flags ().GetString ("operator-endpoint" )
664653 if err != nil {
665- operatorEndpoint , err = getOperatorEndpoint ()
666- if err != nil {
667- cmdFailedf (cmd , "get operator endpoint failed: %s" , err )
668- }
654+ cmdFailedf (cmd , "get operator endpoint failed: %s" , err )
669655 }
670656
671657 client := & http.Client {}
@@ -734,10 +720,7 @@ func getClusterCommand() *cobra.Command {
734720 Run : func (cmd * cobra.Command , args []string ) {
735721 operatorEndpoint , err := cmd .Flags ().GetString ("operator-endpoint" )
736722 if err != nil {
737- operatorEndpoint , err = getOperatorEndpoint ()
738- if err != nil {
739- cmdFailedf (cmd , "get operator endpoint failed: %s" , err )
740- }
723+ cmdFailedf (cmd , "get operator endpoint failed: %s" , err )
741724 }
742725
743726 client := & http.Client {}
0 commit comments