Description of problem: While we could argue that the command should not be run on its own but it does point out an issue with the container that we should consider. sh-4.4# etcdctl move-leader 8e9e05c52164694d 2021-01-20 16:30:51.176860 C | pkg/flags: conflicting environment variable "ETCDCTL_CERT" is shadowed by corresponding command-line flag (either unset environment variable or disable flag) this is an upstream bug that we should address something is wrong with cobra. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. run etcdctl member remove $id inside etcdctl container 2. 3. Actual results: command fails as it believes it is consuming ETCDCTL_CERT while passing flag --cert flag which it is clearly not. Expected results: command works Additional info:
This bug hasn't had any activity in the last 30 days. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're marking this bug as "LifecycleStale" and decreasing the severity/priority. If you have further information on the current state of the bug, please update it, otherwise this bug can be closed in about 7 days. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. Additionally, you can add LifecycleFrozen into Keywords if you think this bug should never be marked as stale. Please consult with bug assignee before you do that.
Hi Sam, With https://github.com/etcd-io/etcd/pull/11775: ➜ ~ oc rsh -n openshift-etcd etcd-master-0.example.com Defaulting container name to etcdctl. Use 'oc describe pod/etcd-master-0.example.com -n openshift-etcd' to see all of the containers in this pod. sh-4.4# /tmp/etcdctl move-leader aea116dbb5d40084 Leadership transferred from d6da693211cb40a to aea116dbb5d40084 sh-4.4# It's because mustClientFromCmd calls clientConfigFromCmd in https://github.com/zerodayz/etcd/blob/34bd797e6754911ee540e8c87f708f88ffe89f37/etcdctl/ctlv3/command/move_leader_command.go#L45 func mustClientFromCmd(cmd *cobra.Command) *clientv3.Client { cfg := clientConfigFromCmd(cmd) return cfg.mustClient() } And then again in https://github.com/zerodayz/etcd/blob/34bd797e6754911ee540e8c87f708f88ffe89f37/etcdctl/ctlv3/command/move_leader_command.go#L55 for _, ep := range eps { cfg := clientConfigFromCmd(cmd) cfg.endpoints = []string{ep} cli := cfg.mustClient() clientConfigFromCmd initiates twice the variables, the second time they are already configured and flags complains it's already set. Seems like the PR was never merged and closed.
The LifecycleStale keyword was removed because the bug got commented on recently. The bug assignee was notified.
updated the upstream PR: https://github.com/etcd-io/etcd/pull/14307