propolis-cli: accept ip:port for server address#1148
Open
MorganaFuture wants to merge 1 commit into
Open
Conversation
`-s` parsed only a host and threw away any port, so `-s 127.0.0.1:12345` failed with a name resolution error. Parse the server argument as a full socket address and drop the now-redundant `-p` flag, matching how propolis-server already takes its IP:PORT argument.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
propolis-cli -sparsed its argument as a bare host and discarded any port, so passing-s 127.0.0.1:12345(the formpropolis-serverprints and accepts) failed with "node name or service name not known". This parses the server argument as a full socket address and drops the now-redundant-pflag, so-stakesIP:PORTthe same waypropolis-server runalready does. Themigratedestination argument gets the same treatment, and the README/docs examples are updated to match.Note this is a small breaking change to the CLI: a port is now required (there's no default
12400anymore), per the issue's suggestion to "expect ip:port in all cases".Closes #1062.
Tested with
cargo test -p propolis-cli(added unit tests for the parser) andcargo clippy, built on Linux. I don't have an illumos host, so I couldn't exercise the CLI end-to-end against a running propolis-server.