-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
28373: cli: make --host/--{listen,advertise,http}-addr recognize port numbers r=knz a=knz cc @jseldess @Amruta-Ranade Fixes #23277. Needed for #5816. Prior to this patch, the various `cockroach` sub-commands would take separate flags to specify an address/hostanme and to specify a port number. Meanwhile: 1. `--join` would recognize the syntax `host:port`. 2. the web UI, docs and other places often refer to a "server address" as the pair hostname:portnr. For user convenience, it is thus important to make the interface more straightforward/regular. This patch achieves this as follows: - the flags `--listen-addr`/`--advertise-addr`/`--http-addr` (server-side) and `--host` (client-side) now recognize the syntax `host/addr:port`. - the server-side `--port` flags are still recognized for backward compatibility but are marked as deprecated. The client-side `--port` is still recognized and not deprecated for now, but hidden from the contextual help. As a side-effect of recognizing the port number inside the same flag, the syntax with square brackets for IPv6 addresses now becomes necessary when specifying also a port number. The syntax without square brackets (and without port number) is temporarily still recognized for backward compatibility, but is also marked as deprecated. Release note (cli change): the server-side command line flag `--listen-addr`, which replaces the previous `--host` flag, is now equipped to recognize both a hostname/address and port number. The `--port` flag is deprecated as a result. Release note (cli change): the server-side command line flag `--http-addr`, which replaces the previous `--http-host` flag, is now equipped to recognize both a hostname/address and port number. The `--http-port` flag is deprecated as a result. Release note (cli change): the server-side command line flag `--advertise-addr`, which replaces the previous `--advertise-host` flag, is now equipped to recognize both a hostname/address and port number. The `--advertise-port` flag is deprecated as a result. Release note (cli change): the client-side command line flag `--host` is now equipped to recognize both a hostname/address and port number. The client-side `--port` flag is still recognized, but not documented any more; `--host` is now preferred. Release note (cli change): the environment variable COCKROACH_PORT that specifies the port number to use for client commands is now deprecated. The port number can be placed in the COCKROACH_HOST environment variable instead. Release note (cli change): The syntax to specify IPv6 addresses with the client-side command line flag `--host` is changed to use square brackets, for example `--host=[::1]` instead of just `--host=::1` previously. The previous syntax is still recognized for backward compatibility but is deprecated. Release note (cli change): the flag `--listen-port` which was introduced in a recent change is now removed. (DOCS NOTE: remove both this release note and the previous one that introduced --listen-port) Co-authored-by: Raphael 'kena' Poss <knz@cockroachlabs.com>
- Loading branch information
Showing
17 changed files
with
174 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.