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: make --host/--{listen,advertise,http}-addr recognize port numbers #28373

Merged
merged 1 commit into from Aug 9, 2018

Commits on Aug 9, 2018

  1. cli: make --host/--{listen,advertise,http}-addr recognize port numbers

    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)
    knz committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    2e99384 View commit details
    Browse the repository at this point in the history