@@ -44,6 +44,7 @@ import (
44
44
"k8s.io/minikube/pkg/minikube/machine"
45
45
"k8s.io/minikube/pkg/minikube/mustload"
46
46
"k8s.io/minikube/pkg/minikube/node"
47
+ "k8s.io/minikube/pkg/minikube/out"
47
48
"k8s.io/minikube/pkg/minikube/out/register"
48
49
"k8s.io/minikube/pkg/minikube/reason"
49
50
"k8s.io/minikube/pkg/version"
@@ -196,10 +197,13 @@ var statusCmd = &cobra.Command{
196
197
Exit status contains the status of minikube's VM, cluster and Kubernetes encoded on it's bits in this order from right to left.
197
198
Eg: 7 meaning: 1 (for minikube NOK) + 2 (for cluster NOK) + 4 (for Kubernetes NOK)` ,
198
199
Run : func (cmd * cobra.Command , args []string ) {
200
+ output = strings .ToLower (output )
199
201
if output != "text" && statusFormat != defaultStatusFormat {
200
202
exit .Message (reason .Usage , "Cannot use both --output and --format options" )
201
203
}
202
204
205
+ out .SetJSON (output == "json" )
206
+
203
207
cname := ClusterFlagValue ()
204
208
api , cc := mustload .Partial (cname )
205
209
@@ -233,7 +237,7 @@ var statusCmd = &cobra.Command{
233
237
}
234
238
}
235
239
236
- switch strings . ToLower ( output ) {
240
+ switch output {
237
241
case "text" :
238
242
for _ , st := range statuses {
239
243
if err := statusText (st , os .Stdout ); err != nil {
@@ -544,7 +548,7 @@ func clusterState(sts []*Status) ClusterState {
544
548
}
545
549
exitCode , err := strconv .Atoi (data ["exitcode" ])
546
550
if err != nil {
547
- klog .Errorf ("unable to convert exit code to int : %v" , err )
551
+ klog .Errorf ("exit code not found : %v" , err )
548
552
continue
549
553
}
550
554
if val , ok := exitCodeToHTTPCode [exitCode ]; ok {
0 commit comments