-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Move clientconfig into clientv3 so that it can be reused by both etcd… #13751
Conversation
Codecov Report
@@ Coverage Diff @@
## main #13751 +/- ##
==========================================
- Coverage 72.78% 72.71% -0.07%
==========================================
Files 467 467
Lines 38279 38283 +4
==========================================
- Hits 27862 27839 -23
- Misses 8622 8637 +15
- Partials 1795 1807 +12
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
ac77565
to
3325653
Compare
All test are green now. Please take a look. @serathius @ptabor @spzala |
3325653
to
788b109
Compare
Overall looks much better than previous PR, with clearer PR we can see one additional problem clarity of public client interface. As a really good refactor I would normally merge it as a gradual improvement, however with this adding to public package interface I'm not sure if we can leave things as they are without long term plan how client configuration should look at in the end. This is because I expect that this package cannot introduce a breaking change in configuration. I see two things:
|
Yes, it's a valid concern. We have two solutions for now,
Please let me know if you have any better proposal. |
The crucial different between: "Config" and "ClientConfig" is that "Config" is mostly a resolved configuration, i.e. it contains objects likes Loggers, TLS that are not serialisable any longer (and especially directly) and that can be potentially shared between objects. The ClientConfig is supposed to be fully declarative configuration that is serializable to JSON or set of flags, and after serialization and deserialization the same exact object can be reached. I'm leaning towards:
|
Thanks @ptabor. It makes sense to change But I do not see any need or use case to convert |
788b109
to
3ea8d7b
Compare
Does it make more sense to rename I changed the ClientConfig to ConfigSpec. Please kindly let me know if you have any comments. |
daccc9a
to
8e21075
Compare
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.
Great change! Thanks for the followups!
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.
…ctl and v3 discovery
8e21075
to
f9aa598
Compare
All test passed (we can ignore the semaphoreci failure, which is due to dockerhub rate limit). PTAL cc @serathius @ptabor @spzala |
The ClientConfig is a fully declarive configuration, so it makes more sense to rename it to ConfigSpec. It can also mitigate the confusion between Config and ClientConfig.
f9aa598
to
1a3822f
Compare
All test passes after re-triggering the pipeline. |
Part of 13624, and it's one of the follow-ups to PR 13635.
Move the original clientConfig from etcdctl to clientv3, so that it can be reused by both etcdctl and v3 discovery.
Note that etcd uses golang's standard package
flag
to process command line flags, while etcdctl usesgithub.com/spf13/pflag
, and etcdctl and v3 discovery has different flag names, such as--endpoints
vs--discovery-endpoints
. So it's difficult to share the same code to process flags between them. So the command line flags keep unchanged in this PR.cc @serathius @ptabor @spzala