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

[25.0 backport] docker stack: allow '=' separator in extra_hosts #4910

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

vvoland
Copy link
Contributor

@vvoland vvoland commented Mar 4, 2024

- What I did

The compose file format allows = as a separator in extra hosts, and docker compose config uses it instead of :.

Accept either separator in docker stack deploy, converting to : for the engine's API.

Also, remove brackets from IP addresses, as they're allowed by the compose file (although not generated by docker compose config).

Fixes #4859

- How I did it

Similar to changes in the CLI's --add-hosts, buildx and compose - check for an = separator first, then try :, and strip the brackets.

- How to verify it

As described in #4859 - plus updated unit tests.

- Description for the changelog

Accept '=' separators and '[ipv6]' in compose files for 'docker stack deploy'.

extra_hosts in the compose file format allows '=' as a separator, and brackets
around IP addresses, the engine API doesn't.

So, transform the values when reading a compose file for 'docker stack'.

Signed-off-by: Rob Murray <rob.murray@docker.com>
(cherry picked from commit c986d09)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@codecov-commenter
Copy link

Codecov Report

Merging #4910 (1cddb2b) into 25.0 (08eba22) will increase coverage by 0.02%.
Report is 5 commits behind head on 25.0.
The diff coverage is 92.30%.

Additional details and impacted files
@@            Coverage Diff             @@
##             25.0    #4910      +/-   ##
==========================================
+ Coverage   61.32%   61.35%   +0.02%     
==========================================
  Files         287      287              
  Lines       20071    20088      +17     
==========================================
+ Hits        12309    12324      +15     
- Misses       6869     6870       +1     
- Partials      893      894       +1     

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

@thaJeztah thaJeztah merged commit eb223e7 into docker:25.0 Mar 4, 2024
75 checks passed
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.

None yet

4 participants