Add support for endpoint-specific MAC address#11208
Merged
ndeloof merged 1 commit intodocker:mainfrom Dec 18, 2023
Merged
Conversation
71513d4 to
6db3b46
Compare
ndeloof
approved these changes
Dec 12, 2023
Contributor
ndeloof
left a comment
There was a problem hiding this comment.
LGTM, please rebase so we can merge
pkg/compose/create.go
Outdated
|
|
||
| // TODO(aker): maybe show a warning and reset all mac_address fields except for the main endpoint? | ||
| if len(withMacAddress) > 1 { | ||
| return createConfigs{}, fmt.Errorf("a MAC address is specified for multiple networks (%s), but the target Docker Engine is too old to support that", strings.Join(withMacAddress, ", ")) |
Contributor
There was a problem hiding this comment.
better let user know the exact version needed, see https://github.com/docker/compose/pull/10939/files#diff-afca7d69550488d990f7db87d3d979a6980f6029c8c86e6b24e26858e87aa70cR77
Related to: - compose-spec/compose-spec#435 - moby/moby#45905 Since API v1.44, Moby supports a per-endpoint MAC address and returns a warning when the container-wide mac_address field is set. A corresponding field has been added to compose-spec and compose-go, so we need to leverage it to set the right API field. This commit is backward-compatible with compose files that still set the container-wide mac_address field, and older API versions that don't know about the endpoint-specific MAC address field. Signed-off-by: Albin Kerouanton <albinker@gmail.com>
6db3b46 to
05c047d
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #11208 +/- ##
==========================================
+ Coverage 56.20% 56.34% +0.14%
==========================================
Files 134 134
Lines 11564 11604 +40
==========================================
+ Hits 6499 6538 +39
+ Misses 4421 4419 -2
- Partials 644 647 +3 ☔ View full report in Codecov by Sentry. |
ndeloof
approved these changes
Dec 18, 2023
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.
Related to:
Since API v1.44, Moby supports a per-endpoint MAC address and returns a warning when the container-wide mac_address field is set.
A corresponding field has been added to compose-spec and compose-go, so we need to leverage it to set the right API field.
This commit is backward-compatible with compose files that still set the container-wide mac_address field, and older API versions that don't know about the endpoint-specific MAC address field.
What I did
Related issue
(not mandatory) A picture of a cute animal, if possible in relation to what you did