Skip to content

Commit

Permalink
MergeInto should include Volumes (#1376)
Browse files Browse the repository at this point in the history
We were dropping these :(

Signed-off-by: Jon Johnson <jon.johnson@chainguard.dev>
  • Loading branch information
jonjohnsonjr authored Oct 29, 2024
1 parent 48f3c87 commit 6a3e0cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/build/types/image_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ func (ic *ImageConfiguration) MergeInto(target *ImageConfiguration) error {
}
}

target.Volumes = slices.Concat(ic.Volumes, target.Volumes)

// Update the contents.
return ic.Contents.MergeInto(&target.Contents)
}
Expand Down
6 changes: 6 additions & 0 deletions pkg/build/types/image_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ func TestMergeInto(t *testing.T) {
"org.extra": "foo",
"org.blah": "foo",
},
Volumes: []string{
"volume1",
},
},
target: types.ImageConfiguration{
Contents: types.ImageContents{
Expand All @@ -102,6 +105,9 @@ func TestMergeInto(t *testing.T) {
"org.extra": "foo",
"org.blah": "foo",
},
Volumes: []string{
"volume1",
},
},
}, {
name: "simple blend of contents",
Expand Down

0 comments on commit 6a3e0cb

Please sign in to comment.