Skip to content

Commit

Permalink
Show more relevant information in argocd cluster add
Browse files Browse the repository at this point in the history
  • Loading branch information
jessesuen committed Apr 10, 2018
1 parent 7e47b1e commit 8a90b32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/argocd/commands/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func printContexts(ca clientcmd.ConfigAccess) {
errors.CheckError(err)
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
defer func() { _ = w.Flush() }()
columnNames := []string{"CURRENT", "NAME", "CLUSTER", "AUTHINFO", "NAMESPACE"}
columnNames := []string{"CURRENT", "NAME", "CLUSTER", "SERVER"}
_, err = fmt.Fprintf(w, "%s\n", strings.Join(columnNames, "\t"))
errors.CheckError(err)

Expand All @@ -100,11 +100,12 @@ func printContexts(ca clientcmd.ConfigAccess) {

for _, name := range contextNames {
context := config.Contexts[name]
cluster := config.Clusters[context.Cluster]
prefix := " "
if config.CurrentContext == name {
prefix = "*"
}
_, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\n", prefix, name, context.Cluster, context.AuthInfo, context.Namespace)
_, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", prefix, name, context.Cluster, cluster.Server)
errors.CheckError(err)
}
}
Expand Down

0 comments on commit 8a90b32

Please sign in to comment.