-
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
etcdctl member list
should return member IDs in a consistent format
#9535
Comments
Also, the member ID probably should be quoted as a string rather than left bare as a number, even if in decimal form. |
Member ID is defined as |
We can get the member ID from the text listing, but we have to treat it as unstructured data (apart from comma-separation) rather than having a nice solid jq pipeline for it. Other JSON parsers exist but jq is pretty universal so we'd like to be able to use it for this too instead of using a different tool just for this one thing. It also makes things harder in this specific instance because what we're doing is parsing out the member ID based on the endpoint URL using jq, and then using that member ID to operate on the peer in question. If the member ID gets mangled by jq then we can't do that in one step like we could otherwise. Just to throw out some ideas:
|
Moving discussion to #9975. |
When I run
etcdctl member list
, i get the member ID back as a hex string. However, when I runetcdctl member list -w json
, I get the member IDs as decimal strings. This is especially unfortunate when using jq to parse the output as jq mangles anything that looks like a large integer to a double-size int, meaning that the etcd member ID breaks (and this has been raised with the jq team and they insist the behavior of jq is allowed, see for example jqlang/jq#369).Using
--hex=true
or--hex=false
seems to have no effect on the etcdctl output.etcdctl should return the member ID in a consistent number format regardless of the output format. Ideally it should always default to hex strings since that gets around the jq number-parsing issue.
The text was updated successfully, but these errors were encountered: