Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
Couple of gravity cli tweaks. (#895)
Browse files Browse the repository at this point in the history
  • Loading branch information
r0mant authored Nov 20, 2019
1 parent 62e35f0 commit 28054ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 3 additions & 1 deletion tool/gravity/cli/run.go
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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(),
Expand Down
9 changes: 3 additions & 6 deletions tool/gravity/cli/status.go
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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 {
Expand All @@ -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)
}

Expand Down

0 comments on commit 28054ce

Please sign in to comment.