Skip to content
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

Merged
merged 1 commit into from
Jun 3, 2019

Conversation

knz
Copy link
Contributor

@knz knz commented Jun 3, 2019

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.

@knz knz requested review from bdarnell and andreimatei June 3, 2019 15:17
@knz knz requested a review from a team as a code owner June 3, 2019 15:17
@knz
Copy link
Contributor Author

knz commented Jun 3, 2019

(will backport)

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@awoods187
Copy link
Contributor

@knz thank you for the speedy turnaround! It is much appreciated.

@knz knz force-pushed the 20190603-fix-ipv6 branch from dbb491d to a11a719 Compare June 3, 2019 15:19
@knz
Copy link
Contributor Author

knz commented Jun 3, 2019

@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).

@bdarnell
Copy link
Contributor

bdarnell commented Jun 3, 2019

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).

@knz
Copy link
Contributor Author

knz commented Jun 3, 2019

I'm not keen to turn a problem from bad to worse.

Copy link
Contributor

@andreimatei andreimatei left a 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: :shipit: 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.
@knz knz force-pushed the 20190603-fix-ipv6 branch from a11a719 to ab4f77a Compare June 3, 2019 19:42
Copy link
Contributor Author

@knz knz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: 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.

@knz
Copy link
Contributor Author

knz commented Jun 3, 2019

TFYR

bors r+

craig bot pushed a commit that referenced this pull request Jun 3, 2019
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]>
@craig
Copy link
Contributor

craig bot commented Jun 3, 2019

Build succeeded

@craig craig bot merged commit ab4f77a into cockroachdb:master Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cli: init fails with IPv6 literal
5 participants