-
Notifications
You must be signed in to change notification settings - Fork 323
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
Add command to consul-k8s-control-plane
: gossip-encryption-autogenerate
#772
Conversation
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.
This is looking really good! I've got some suggestions to simplify things even further but overall things are excellent.
I'll probably not get back to this PR next week so feel free to merge once you've got the requisite approvals from others.
control-plane/subcommand/gossip-encryption-autogenerate/command.go
Outdated
Show resolved
Hide resolved
control-plane/subcommand/gossip-encryption-autogenerate/command.go
Outdated
Show resolved
Hide resolved
control-plane/subcommand/gossip-encryption-autogenerate/command.go
Outdated
Show resolved
Hide resolved
control-plane/subcommand/gossip-encryption-autogenerate/command.go
Outdated
Show resolved
Hide resolved
control-plane/subcommand/gossip-encryption-autogenerate/command.go
Outdated
Show resolved
Hide resolved
control-plane/subcommand/gossip-encryption-autogenerate/command.go
Outdated
Show resolved
Hide resolved
control-plane/subcommand/gossip-encryption-autogenerate/command.go
Outdated
Show resolved
Hide resolved
control-plane/subcommand/gossip-encryption-autogenerate/command_test.go
Outdated
Show resolved
Hide resolved
control-plane/subcommand/gossip-encryption-autogenerate/command_test.go
Outdated
Show resolved
Hide resolved
control-plane/subcommand/gossip-encryption-autogenerate/command_test.go
Outdated
Show resolved
Hide resolved
@lkysow, thank you for a great review! I have implemented all of your suggestions. |
Co-authored-by: Kyle Schochenmaier <[email protected]>
control-plane/subcommand/gossip-encryption-autogenerate/command.go
Outdated
Show resolved
Hide resolved
control-plane/subcommand/gossip-encryption-autogenerate/command.go
Outdated
Show resolved
Hide resolved
control-plane/subcommand/gossip-encryption-autogenerate/command.go
Outdated
Show resolved
Hide resolved
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.
This looks great, I left a few comments but overall it's looking good.
One thing I'd like to sort out before merging is being consistent on using k8s
vs kubernetes
, especially in error messages.
(bonus points if we can clean it up to be consistent on data structure names, flags and function names)
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.
This looks great, Thomas!!
control-plane/subcommand/gossip-encryption-autogenerate/command.go
Outdated
Show resolved
Hide resolved
…d.go Co-authored-by: Nitya Dhanushkodi <[email protected]>
Changes proposed in this PR:
consul-k8s-control-plane
calledgossip-encryption-autogenerate
This command takes in a
namespace
and asecret-name
, checks for a kubeconfig being passed in or uses the default for the system. It checks if a secret already exists with the givensecret-name
and fails safely with code0
if so. Otherwise it generates a 32 byte random string and stores it in the Kubernetes secret store.How I've tested this PR:
How I expect reviewers to test this PR:
./control-plane
withgo run . gossip-encryption-autogenerate -namespace default -secret-name my-special-secret
key
value is a random base 64 encoded 32 byte string. Then rungo run . gossip-encryption-autogenerate -namespace default -secret-name my-special-secret
my-special-secret
already exists." without overwriting the secret at that location.Checklist: