Repository navigation
fix(override): merge ulimits into the base value - #907
Merged
Merged
Conversation
mergeUlimit read both the base and the override mapping from the same argument, so it merged the override with itself and dropped the base. A service that sets ulimits.locks.soft in the base file and only ulimits.locks.hard in the override file lost the soft limit. Take the base mapping from the base argument, which was declared and then ignored. The existing test encoded the old behaviour and is updated to expect the base value to survive. Signed-off-by: Vladimir Saraikin <saraikin.v@phystech.edu>
ndeloof
approved these changes
Aug 11, 2026
ndeloof
enabled auto-merge (rebase)
August 11, 2026 14:50
ndeloof
approved these changes
Aug 11, 2026
ndeloof
left a comment
Collaborator
There was a problem hiding this comment.
Verified locally: the updated test fails with the previous merge.go (the old expectation encoded the buggy output) and the override+loader suites are green with the fix. Merge semantics for the scalar/mapping mismatch cases are unchanged. I'll follow up with an additional test covering short/long syntax combinations.
glours
pushed a commit
to ndeloof/compose-go
that referenced
this pull request
Sep 2, 2026
Follow-up to compose-spec#907: exercise every combination of the short (single limit) and long (soft/hard mapping) ulimit syntaxes between base and override. Mappings merge key by key; a syntax mismatch makes the override value win as a whole β the short-over-long case (the 'return o, nil' path in mergeUlimit) was previously untested. Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
glours
pushed a commit
that referenced
this pull request
Sep 2, 2026
Follow-up to #907: exercise every combination of the short (single limit) and long (soft/hard mapping) ulimit syntaxes between base and override. Mappings merge key by key; a syntax mismatch makes the override value win as a whole β the short-over-long case (the 'return o, nil' path in mergeUlimit) was previously untested. Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
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.
Set one ulimit key in the base file and a different one in the override, and the base key disappears:
mergeUlimitreceives the base value and the override value, but it reads both mappings out of the override:So it merges the override with itself. The base argument is named
_and never read. Every other function inmergeSpecialstakes its first argument as the base, this one is the exception.Test_mergeYamlUlimitsalready covered the case, but its expectation encoded the old behaviour, so it is updated to expect the basesoftto survive. Revertingmerge.goalone makes it fail. Full suite is green