From 28054ceff87618ae79c4333c89abe89318694135 Mon Sep 17 00:00:00 2001 From: Roman Tkachenko Date: Wed, 20 Nov 2019 13:08:21 -0800 Subject: [PATCH] Couple of gravity cli tweaks. (#895) --- tool/gravity/cli/run.go | 4 +++- tool/gravity/cli/status.go | 9 +++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tool/gravity/cli/run.go b/tool/gravity/cli/run.go index 43ecf24421..edf06995e8 100644 --- a/tool/gravity/cli/run.go +++ b/tool/gravity/cli/run.go @@ -1,5 +1,5 @@ /* -Copyright 2018 Gravitational, Inc. +Copyright 2018-2019 Gravitational, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -182,6 +182,8 @@ func InitAndCheck(g *Application, cmd string) error { g.InstallCmd.FullCommand(), g.JoinCmd.FullCommand(), g.AutoJoinCmd.FullCommand(), + g.LeaveCmd.FullCommand(), + g.RemoveCmd.FullCommand(), g.SystemDevicemapperMountCmd.FullCommand(), g.SystemDevicemapperUnmountCmd.FullCommand(), g.BackupCmd.FullCommand(), diff --git a/tool/gravity/cli/status.go b/tool/gravity/cli/status.go index 0eaa8abce2..32b8ab6fbc 100644 --- a/tool/gravity/cli/status.go +++ b/tool/gravity/cli/status.go @@ -1,5 +1,5 @@ /* -Copyright 2018 Gravitational, Inc. +Copyright 2018-2019 Gravitational, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -262,6 +262,7 @@ func printStatusText(cluster clusterStatus) { w.Init(os.Stdout, 0, 8, 1, '\t', 0) if cluster.Cluster != nil { + fmt.Fprintf(w, "Cluster name:\t%v\n", unknownFallback(cluster.Cluster.Domain)) if cluster.Status.IsDegraded() { fmt.Fprintf(w, "Cluster status:\t%v\n", color.RedString("degraded")) } else { @@ -271,11 +272,7 @@ func printStatusText(cluster clusterStatus) { } if cluster.Agent != nil { - var domain string - if cluster.Cluster != nil { - domain = cluster.Cluster.Domain - } - fmt.Fprintf(w, "Cluster nodes:\t%v\n", unknownFallback(domain)) + fmt.Fprintf(w, "Cluster nodes:\n") printAgentStatus(*cluster.Agent, w) }