agent: display messages from serf in cli (#5236)

* display messages from serf in cli
This commit is contained in:
Hans Hasselberg 2019-01-22 21:08:50 +01:00 committed by GitHub
parent 2abc48c1eb
commit 174099593a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -16,6 +16,9 @@ type KeyringResponse struct {
// Segment has the network segment this request corresponds to.
Segment string
// Messages has information or errors from serf
Messages map[string]string `json:",omitempty"`
// A map of the encryption keys to the number of nodes they're installed on
Keys map[string]int

View File

@ -154,6 +154,11 @@ func (c *cmd) handleList(responses []*consulapi.KeyringResponse) {
c.UI.Output("")
c.UI.Output(pool + ":")
for from, msg := range response.Messages {
c.UI.Output(fmt.Sprintf(" ===> %s: %s", from, msg))
}
for key, num := range response.Keys {
c.UI.Output(fmt.Sprintf(" %s [%d/%d]", key, num, response.NumNodes))
}