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

Fix duplicates when overlaying the config with config with no contents #1119

Merged
merged 4 commits into from
May 14, 2024

Conversation

sfc-gh-mhazy
Copy link
Contributor

@sfc-gh-mhazy sfc-gh-mhazy commented May 9, 2024

The problem was with

copier.CopyWithOption(&mergedIc, ic, copier.Option{IgnoreEmpty: true})

If Contents object of overlay config was empty, then the merged config kept the repeated fields of contents from base config. Then the merging of repeated fields was done as concatenating base arrays with merged arrays, effectively doubling each array from base.

Signed-off-by: Mateusz Hazy <[email protected]>
Signed-off-by: Mateusz Hazy <[email protected]>
@sfc-gh-ptabor
Copy link
Contributor

Fixes: #1117

@sfc-gh-mhazy sfc-gh-mhazy marked this pull request as ready for review May 14, 2024 07:40
@jonjohnsonjr jonjohnsonjr merged commit eacdde3 into chainguard-dev:main May 14, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants