From 174099593a5afce96f59d66983c37ede757ae920 Mon Sep 17 00:00:00 2001 From: Hans Hasselberg Date: Tue, 22 Jan 2019 21:08:50 +0100 Subject: [PATCH] agent: display messages from serf in cli (#5236) * display messages from serf in cli --- api/operator_keyring.go | 3 +++ command/keyring/keyring.go | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/api/operator_keyring.go b/api/operator_keyring.go index 6b614296ce..038d5d5b02 100644 --- a/api/operator_keyring.go +++ b/api/operator_keyring.go @@ -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 diff --git a/command/keyring/keyring.go b/command/keyring/keyring.go index 33c3297920..b9a12732a7 100644 --- a/command/keyring/keyring.go +++ b/command/keyring/keyring.go @@ -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)) }