-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Sensible keyring error #7272
Sensible keyring error #7272
Conversation
Fixes #7231. Before an agent would always emit a warning when there is an encrypt key in the configuration and an existing keyring stored, which is happening on restart. Now it only emits that warning when the encrypt key from the configuration is not part of the keyring.
test failures are related. will fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have the one non-blocking comment about log messages but otherwise this looks great.
agent/agent.go
Outdated
config.SerfLANConfig.MemberlistConfig.Keyring, | ||
a.config.EncryptKey, | ||
) { | ||
a.logger.Warn("LAN" + msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
I think this would be more consistent with existing logs if it were:
a.logger.Warn(msg, "keyring", "WAN")
During the hclog refactor it looked like most of the places that we had previously formatted a log message we turned into having a constant string message and passing the other data to the logger as kv pairs.
The same thing goes for the log for the "LAN" case too. If you really prefer this form, then thats fine with me too. My opinions on the subject are not very strong either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Matt! This was actually a thing I kept wondering how to do with the new logger! I like your suggestion and will go with it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Fixes #7231. Before an agent would always emit a warning when there is
an encrypt key in the configuration and an existing keyring stored,
which is happening on restart.
Now it only emits that warning when the encrypt key from the
configuration is not part of the keyring.
I feel a little bad, because
setupBaseKeyrings
is not pretty and I would like to make it better. But that would mean more changes that don't contribute to the fix at hand. Will leave that for later.