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/formatter: bracket IPv6 addrs prepended to ports #5363

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

akerouanton
Copy link
Member

@akerouanton akerouanton commented Aug 20, 2024

- What I did

On docker ps, port bindings with an IPv6 HostIP should have their addresses put into brackets when joining them to their ports.

RFC 3986 (Section 3.2.2) stipulates that IPv6 addresses should be enclosed within square brackets. This RFC is only about URIs. However, doing so here helps user identifier what's part of the IP address and what's the port. It also makes it easier to copy/paste that '[addr]:port' into other software (including browsers).

- How to verify it

CI, or run the following commands with a recent Engine:

$ docker run --rm -d --name c0 -p 8000:80/tcp 5201/udp alpine top
$ docker ps

- Description for the changelog

- IPv6 addresses shown by `docker ps` in port bindings are now bracketed

On `docker ps`, port bindings with an IPv6 HostIP should have their
addresses put into brackets when joining them to their ports.

RFC 3986 (Section 3.2.2) stipulates that IPv6 addresses should be
enclosed within square brackets. This RFC is only about URIs. However,
doing so here helps user identifier what's part of the IP address and
what's the port. It also makes it easier to copy/paste that
'[addr]:port' into other software (including browsers).

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Aug 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.93%. Comparing base (35666cf) to head (964155c).
Report is 26 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5363      +/-   ##
==========================================
- Coverage   61.46%   60.93%   -0.53%     
==========================================
  Files         299      304       +5     
  Lines       20863    21348     +485     
==========================================
+ Hits        12823    13009     +186     
- Misses       7125     7409     +284     
- Partials      915      930      +15     

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@thaJeztah
Copy link
Member

Reminds me that I still want to port over the changes I added for swarm services to present port-ranges;

@thaJeztah thaJeztah merged commit d47c36d into docker:master Aug 20, 2024
101 of 104 checks passed
@akerouanton akerouanton deleted the fix-ps-pbs branch August 20, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants