-
Notifications
You must be signed in to change notification settings - Fork 3.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
cli: fix use of IPv6 addresses with RPC client commands #37977
Conversation
(will backport) |
@knz thank you for the speedy turnaround! It is much appreciated. |
@bdarnell do you have any idea how to test this effectively? The TC agents don't support ipv6, so neither a direct test nor a docker test would do (ipv6 support is inherited in docker - no ipv6 outside, not inside either). |
Make it a roachtest, to swat a fly with a fleet of battleships? The VMs created by roachprod have ipv6 loopback enabled (although they don't have routable ipv6 addresses). |
I'm not keen to turn a problem from bad to worse. |
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.
LGTM
Do y'all know if we could have routable ipv6 in roachprod? Then we could migrate some random roachtest to ipv6 to exercise this fix (right?)
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @andreimatei, @bdarnell, and @knz)
pkg/cli/cli_test.go, line 429 at r1 (raw file):
} func Example_ipv6_client() {
I don't like this "example" very much. It's not really what examples are supposed to be used for. Also particularly the reference to the bug seems click bait. Also I thought this would not work on TC?
How about just writing a unit test for the addrWithDefaultHost()
function?
Release note (bug fix): the `cockroach` command line utilities that internally use a RPC connection (e.g. `cockroach quit`, `cockroach init`, etc) again properly support passing an IPv6 address literal via the `--host` argument.
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @andreimatei and @bdarnell)
pkg/cli/cli_test.go, line 429 at r1 (raw file):
Also I thought this would not work on TC?
Yeah I was trying this out to see how TC would respond. That's how I found TC didn't like it.
How about just writing a unit test for the addrWithDefaultHost() function?
Yep, that's the better idea. Done.
TFYR bors r+ |
37942: sql: Adding support for show indexes from database command r=rohany a=rohany As requested in #37270, support for a show indexes from database command would be helpful. This PR includes support for the command in the parser. Future PR's will implement the functionality of the parsed results. 37977: cli: fix use of IPv6 addresses with RPC client commands r=knz a=knz Fixes #33008. (This was actually a regression of my doing, back from #28373. Didn't pick it up back then because we didn't have a test.) Release note (bug fix): the `cockroach` command line utilities that internally use a RPC connection (e.g. `cockroach quit`, `cockroach init`, etc) again properly support passing an IPv6 address literal via the `--host` argument. Co-authored-by: Rohan Yadav <[email protected]> Co-authored-by: Raphael 'kena' Poss <[email protected]>
Build succeeded |
Fixes #33008.
(This was actually a regression of my doing, back from #28373. Didn't pick it up back then because we didn't have a test.)
Release note (bug fix): the
cockroach
command line utilities thatinternally use a RPC connection (e.g.
cockroach quit
,cockroach init
, etc) again properly support passing an IPv6 address literal viathe
--host
argument.