call 'strings.ToLower(output)' only once
parent
d0c0d8b54c
commit
0c3843bfc6
|
@ -197,11 +197,12 @@ var statusCmd = &cobra.Command{
|
|||
Exit status contains the status of minikube's VM, cluster and Kubernetes encoded on it's bits in this order from right to left.
|
||||
Eg: 7 meaning: 1 (for minikube NOK) + 2 (for cluster NOK) + 4 (for Kubernetes NOK)`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if strings.ToLower(output) != "text" && statusFormat != defaultStatusFormat {
|
||||
output = strings.ToLower(output)
|
||||
if output != "text" && statusFormat != defaultStatusFormat {
|
||||
exit.Message(reason.Usage, "Cannot use both --output and --format options")
|
||||
}
|
||||
|
||||
out.SetJSON(strings.ToLower(output) == "json")
|
||||
out.SetJSON(output == "json")
|
||||
|
||||
cname := ClusterFlagValue()
|
||||
api, cc := mustload.Partial(cname)
|
||||
|
@ -236,7 +237,7 @@ var statusCmd = &cobra.Command{
|
|||
}
|
||||
}
|
||||
|
||||
switch strings.ToLower(output) {
|
||||
switch output {
|
||||
case "text":
|
||||
for _, st := range statuses {
|
||||
if err := statusText(st, os.Stdout); err != nil {
|
||||
|
|
Loading…
Reference in New Issue