-
Notifications
You must be signed in to change notification settings - Fork 7
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
Mitigate against token replication lag #79
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.
Looks good Paul. I left a minor suggestion.. I'll leave it to you to decide whether or not to implement it.
subcommand/mesh-init/command.go
Outdated
newCfg.Address = c.config.ConsulHTTPAddr | ||
newCfg.TLSConfig.CAFile = c.config.ConsulCACertFile | ||
newCfg.TokenFile = cfg.TokenFile | ||
newCfg.Token = cfg.Token |
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 don't love the way I "clone" this config. I could change the function to receive a value/copy, e.g. waitForTokenReplication(cfg api.Config)
, so that the function receives a copy, but there are some pointer fields on the api.Config
type...
Maybe a common function to construct a new config will help.
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.
What about updating the waitForTokenReplication
to just take the token file and token args?.. those are the only fields from the client config that the func uses.
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 updated this. I realized it just needed the TokenFile and not the Token as well.
Changes proposed in this PR:
Copy the consul-k8s approach for dealing with inherent token replication lag.
How I've tested this PR:
How I expect reviewers to test this PR:
👀
Checklist:
CHANGELOG entry addedn/a, part of unreleased auth method changes which are already logged