-
Notifications
You must be signed in to change notification settings - Fork 114
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
fix: handle more complex fields during merge #548
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but note that we need the same for services.*.annotations
, services.*.extra_hosts
, and services.*.sysctls
as well 😬
There might be others, but those are all k-v list or maps, so were easy to identify.
c14dde2
to
a2d0265
Compare
I have noticed problems with duplicate IP subnets. docker-compose version 2.24.2 and 2.24.3
override:
docker-compose config shows
Error message on up is:
This was not a problem so far. config shows the overridden subnet and up starts the container in this subnet
if it would be the same subnet in both files it would not be merged:
leading to a more bizarre error:
|
b484d42
to
ba6a986
Compare
override/merge.go
Outdated
@@ -180,6 +195,16 @@ func mergeUlimit(_ any, o any, p tree.Path) (any, error) { | |||
return o, nil | |||
} | |||
|
|||
func mergeIPAMConfig(c any, o any, path tree.Path) (any, error) { | |||
right := convertIntoMapping(c.([]any)[0], nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get the logic here. Why only merge the first element ?
IIUC we should merge IPAM configs within the same network segment (same subnet
) and append the others
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rohh my bad 🤦
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix that Monday 😞
network1: | ||
ipam: | ||
config: | ||
- subnet: 172.28.0.0/16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tes should include another subnet which should be kept unchanged, + another that should be appended, so we cover all use-cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM besides the already-commented on IPAM merge behavior
438baad
to
11e6b47
Compare
Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Milas Bowman <[email protected]> Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Milas Bowman <[email protected]> Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Milas Bowman <[email protected]> Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Milas Bowman <[email protected]> Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Milas Bowman <[email protected]> Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Milas Bowman <[email protected]> Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Nicolas De Loof <[email protected]> Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Guillaume Lours <[email protected]>
Signed-off-by: Guillaume Lours <[email protected]>
11e6b47
to
454dc0b
Compare
Improve the overall merge process for specific attribute format and uniqueness for lists and sequences
closes docker/compose#11417