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

Commit

Permalink
agent: display messages from serf in cli (hashicorp#5236)
Browse files Browse the repository at this point in the history
* display messages from serf in cli
  • Loading branch information
hanshasselberg authored Jan 22, 2019
1 parent 2abc48c commit 1740995
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/operator_keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions command/keyring/keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit 1740995

Please sign in to comment.