Skip to content

Commit

Permalink
Show data with keys sorted instead of random
Browse files Browse the repository at this point in the history
  • Loading branch information
afbjorklund committed Aug 1, 2021
1 parent 4f6ee47 commit 6e571d8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/minikube/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package cmd
import (
"encoding/json"
"os/exec"
"sort"
"strings"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -86,7 +87,13 @@ var versionCmd = &cobra.Command{
if gitCommitID != "" {
out.Ln("commit: %v", gitCommitID)
}
for k, v := range data {
keys := make([]string, 0, len(data))
for k := range data {
keys = append(keys, k)
}
sort.Strings(keys)
for _, k := range keys {
v := data[k]
// for backward compatibility we keep displaying the old way for these two
if k == "minikubeVersion" || k == "commit" {
continue
Expand Down

0 comments on commit 6e571d8

Please sign in to comment.