-
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
[release-3.5]etcdctl: allow move-leader to connect to multiple endpoints #14434
Conversation
@@ -19,6 +19,7 @@ import ( | |||
"strconv" | |||
|
|||
"github.com/spf13/cobra" | |||
|
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.
minor comment: Did you intentionally add this blank line or it's added by IDE automatically? I would suggest to keep it as it's. Of course, it isn't a big deal.
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.
+1
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.
yep IDE, let me remove it again
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.
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.
@tjungblu thanks! lgtm but I think the PR/commit description is not correct, so I would suggest to at least edit PR description for future reference if someone look at it. First, there is a typo in mustClientForCmd
, it's mustClientCfgFromCmd
. Secondly, it's not the mustClientCfgFromCmd
getting called multiple times resulting into flag related error as the description says. It's the clientConfigFromCmd
that's getting called twice (directly and through mustClientCfgFromCmd
) which the PR provides fix for.
@@ -19,6 +19,7 @@ import ( | |||
"strconv" | |||
|
|||
"github.com/spf13/cobra" | |||
|
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.
+1
Due to a duplicate call of clientConfigFromCmd, the move-leader command would fail with "conflicting environment variable is shadowed by corresponding command-line flag". Also in scenarios where no command-line flag was supplied. Signed-off-by: Thomas Jungblut <[email protected]>
2b14b2a
to
243b7a1
Compare
Thanks for the reviews, fixed the commit message and description and removed that newline. |
@tjungblu Could you please backport this PR to 3.4 as well? |
sure, can do. |
Re-opening closed PR #11775 which was originaly authored by benmoss. Then again opened PR #12757 which was authored by zerodayz. And then a continuation of #14307.
The mustClientForCmd function is responsible for parsing environment variables and flags into configuration data. A change was made in #9382 to call Fatal if a flag is provided multiple times. This means that we cannot call the mustClientForCmd function more than once, since it will think that flags parsed the first time are now being redefined and error out.
Some people have commented about this in #8380 but I don't think there's an open issue for it.
Signed-off-by: Thomas Jungblut [email protected]