Updating minikube profile list cmd table representation

Updated the command line output of minikube profile list -o table to have two columns, i.e. Active Profile and Active Kubecontext. This makes the output more intuitive. Formatting issues are fixed as well.
pull/17735/head
Skalador 2023-12-23 17:23:41 +01:00 committed by Steven Powell
parent 8990648956
commit 92ccbd1049
3 changed files with 6 additions and 6 deletions

View File

@ -190,7 +190,7 @@ func profileStatus(p *config.Profile, api libmachine.API) string {
func renderProfilesTable(ps [][]string) {
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Profile", "VM Driver", "Runtime", "IP", "Port", "Version", "Status", "Nodes", "Active Kubecontext"})
table.SetHeader([]string{"Profile", "VM Driver", "Runtime", "IP", "Port", "Version", "Status", "Nodes", "Active Profile", "Active Kubecontext"})
table.SetAutoFormatHeaders(false)
table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true})
table.SetCenterSeparator("|")

View File

@ -27,8 +27,8 @@ import (
"github.com/spf13/viper"
"k8s.io/klog/v2"
"k8s.io/minikube/pkg/drivers/kic/oci"
"k8s.io/minikube/pkg/minikube/localpath"
"k8s.io/minikube/pkg/minikube/kubeconfig"
"k8s.io/minikube/pkg/minikube/localpath"
"k8s.io/minikube/pkg/util/lock"
)

View File

@ -25,10 +25,10 @@ import (
// Profile represents a minikube profile
type Profile struct {
Name string
Status string // running, stopped, paused, unknown
Config *ClusterConfig
Active bool
Name string
Status string // running, stopped, paused, unknown
Config *ClusterConfig
Active bool
ActiveKubeContext bool
}