Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display messages from serf in cli #5236

Merged
merged 2 commits into from
Jan 22, 2019
Merged

display messages from serf in cli #5236

merged 2 commits into from
Jan 22, 2019

Conversation

hanshasselberg
Copy link
Member

This PR shows the messages from serf when listing encryption keys. Needs hashicorp/serf#546.

Copy link
Member

@banks banks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! An example of what this looks like in practice in the PR description would be extra useful but this seems reasonable!

@hanshasselberg
Copy link
Member Author

In case of too many keys it looks like that with 3 servers and 20 clients:

$ consul keyring -list
==> Gathering installed encryption keys...

WAN:
  ===> l.dc1: truncated key list response, showing first 35 of 51 keys
  ===> s1.dc1: truncated key list response, showing first 35 of 51 keys
  ===> s2.dc1: truncated key list response, showing first 35 of 51 keys
  OvEV7rcTLSapFpKiG0jjGw== [3/3]
  1Ty40u6Dk8TfS/d9tgKjsQ== [3/3]
  9f4Y+1AbSh2UxkYO6LyYGw== [3/3]
  9kZ2mJ94E9mFnM9DyQsGAA== [3/3]
  AEQVHZOXCYAHuqBqx8kb1Q== [3/3]
  nPhbUOxxfVO0waK/Q4/lhg== [3/3]
  /B7pNWgPFYl7USV+WPLqAA== [3/3]
  J+It1aLhS1Lv8kJMEh7Z3g== [3/3]
  SrMp0SvH/At/s8kpSs5nKw== [3/3]
  mdQsc9vIOxwNOjyk4Pgo5g== [3/3]
  tL6kLg1kZW/ry5Gk8njR9g== [3/3]
  vA7+zGspI45mW+bZHXbyRQ== [3/3]
  34jTVOtF/Qw2/TrATsIiIw== [3/3]
  Tq416DQdzmPCSTAyGSlLHA== [3/3]
  Um7HOKl7x0hdfR0crjPY/A== [3/3]
  d0w0FM3LvmSArte2mS9Y3w== [3/3]
  jNlaF7ahFUxhEGYIzH6pxA== [3/3]
  keGbbBa2y8eGvTOxyOhwQw== [3/3]
  kgX+E0XmXYefBxwAuNY9Lw== [3/3]
  uGEHpx1Uy/rLEy5x5vpYew== [3/3]
  N4J2duCWwwY7/QikpqtqRg== [3/3]
  XgVr0n8l3qWwI66keY5cmw== [3/3]
  g54gcnUliSdYyTsowNt0yA== [3/3]
  jDsV392GiQxLshtK+ZAF6g== [3/3]
  wsLaB5pslJLUIHclhJO7wg== [3/3]
  PKMdT5oxQgTxreM+CO+bHw== [3/3]
  pyrDjzE1TFcjLkDjTkmqiA== [3/3]
  zEv7GRaegpKkTOlcdSbVyA== [3/3]
  +QD50DzrMPGkQMogX13s4w== [3/3]
  /ypFlGEbdpYbeojRyRBD/g== [3/3]
  roo4mYLIH9fH73PlTn0JKQ== [3/3]
  uUv26eYlXQd7nao7huwDKQ== [3/3]
  0Im8lcD9/RakW5RkdZrDmA== [3/3]
  DnQsk7podoetmNbt82sQqw== [3/3]
  l1Bf8PspWc+wXRHMBiJ6aw== [3/3]

dc1 (LAN):
  ===> c10: truncated key list response, showing first 35 of 51 keys
  ===> c11: truncated key list response, showing first 35 of 51 keys
  ===> c12: truncated key list response, showing first 35 of 51 keys
  ===> c13: truncated key list response, showing first 35 of 51 keys
  ===> c16: truncated key list response, showing first 35 of 51 keys
  ===> c2: truncated key list response, showing first 35 of 51 keys
  ===> c7: truncated key list response, showing first 35 of 51 keys
  ===> l: truncated key list response, showing first 35 of 51 keys
  ===> c1: truncated key list response, showing first 35 of 51 keys
  ===> c17: truncated key list response, showing first 35 of 51 keys
  ===> c18: truncated key list response, showing first 35 of 51 keys
  ===> c20: truncated key list response, showing first 35 of 51 keys
  ===> c4: truncated key list response, showing first 35 of 51 keys
  ===> c5: truncated key list response, showing first 35 of 51 keys
  ===> s1: truncated key list response, showing first 35 of 51 keys
  ===> s2: truncated key list response, showing first 35 of 51 keys
  ===> c14: truncated key list response, showing first 35 of 51 keys
  ===> c3: truncated key list response, showing first 35 of 50 keys
  ===> c6: truncated key list response, showing first 35 of 51 keys
  ===> c15: truncated key list response, showing first 35 of 51 keys
  ===> c19: truncated key list response, showing first 35 of 51 keys
  ===> c8: truncated key list response, showing first 35 of 51 keys
  ===> c9: truncated key list response, showing first 35 of 51 keys
  PKMdT5oxQgTxreM+CO+bHw== [23/23]
  uUv26eYlXQd7nao7huwDKQ== [23/23]
  kgX+E0XmXYefBxwAuNY9Lw== [23/23]
  nPhbUOxxfVO0waK/Q4/lhg== [23/23]
  pyrDjzE1TFcjLkDjTkmqiA== [23/23]
  vA7+zGspI45mW+bZHXbyRQ== [23/23]
  /ypFlGEbdpYbeojRyRBD/g== [22/23]
  AEQVHZOXCYAHuqBqx8kb1Q== [23/23]
  N4J2duCWwwY7/QikpqtqRg== [23/23]
  mdQsc9vIOxwNOjyk4Pgo5g== [23/23]
  uGEHpx1Uy/rLEy5x5vpYew== [23/23]
  wsLaB5pslJLUIHclhJO7wg== [23/23]
  J+It1aLhS1Lv8kJMEh7Z3g== [23/23]
  OvEV7rcTLSapFpKiG0jjGw== [23/23]
  Tq416DQdzmPCSTAyGSlLHA== [23/23]
  Um7HOKl7x0hdfR0crjPY/A== [23/23]
  keGbbBa2y8eGvTOxyOhwQw== [23/23]
  sdYIE5FHxhJ4tp/OWs0+bA== [1/23]
  /B7pNWgPFYl7USV+WPLqAA== [23/23]
  1Ty40u6Dk8TfS/d9tgKjsQ== [23/23]
  SrMp0SvH/At/s8kpSs5nKw== [23/23]
  d0w0FM3LvmSArte2mS9Y3w== [23/23]
  roo4mYLIH9fH73PlTn0JKQ== [23/23]
  34jTVOtF/Qw2/TrATsIiIw== [23/23]
  9kZ2mJ94E9mFnM9DyQsGAA== [23/23]
  DnQsk7podoetmNbt82sQqw== [23/23]
  jDsV392GiQxLshtK+ZAF6g== [23/23]
  l1Bf8PspWc+wXRHMBiJ6aw== [23/23]
  tL6kLg1kZW/ry5Gk8njR9g== [23/23]
  +QD50DzrMPGkQMogX13s4w== [23/23]
  0Im8lcD9/RakW5RkdZrDmA== [23/23]
  9f4Y+1AbSh2UxkYO6LyYGw== [23/23]
  g54gcnUliSdYyTsowNt0yA== [23/23]
  XgVr0n8l3qWwI66keY5cmw== [23/23]
  jNlaF7ahFUxhEGYIzH6pxA== [23/23]
  zEv7GRaegpKkTOlcdSbVyA== [23/23]

@@ -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"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it matter that these messages will be randomly ordered? If you stored them as something like [][]string instead of map[string]string then at least you could retain the ordering.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Messages are already in the response from

type KeyringResponse struct {
WAN bool
Datacenter string
Segment string
Messages map[string]string `json:",omitempty"`
Keys map[string]int
NumNodes int
Error string `json:",omitempty"`
}

I only added it here so that it gets deserialized.

Since the results are collected in parallel from all the nodes, I wouldn't even be sure how to order them. The order of arrival could be different every time as well.

@hanshasselberg hanshasselberg merged commit 1740995 into master Jan 22, 2019
@hanshasselberg hanshasselberg deleted the key_list_msg branch January 22, 2019 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants