Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions internal/slicer/slicer.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,13 @@ func Run(options *RunOptions) error {
}

// Do not add paths with "until: mutate".
if pathInfo.Until != setup.UntilMutate {
for _, slice := range slices {
err = report.Add(slice, entry)
if err != nil {
return err
}
for _, slice := range slices {
if slice.Contents[relPath].Until == setup.UntilMutate {
continue
}
err = report.Add(slice, entry)
if err != nil {
return err
}
}
}
Expand Down
27 changes: 26 additions & 1 deletion internal/slicer/slicer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,32 @@ var slicerTests = []slicerTest{{
`,
},
filesystem: map[string]string{"/file": "file 0644 2c26b46b"},
manifestPaths: map[string]string{"/file": "file 0644 2c26b46b {test-package_myslice1,test-package_myslice2}"},
manifestPaths: map[string]string{"/file": "file 0644 2c26b46b {test-package_myslice2}"},
}, {
summary: "Extracted content in packages with until:mutate on one is attributed to the other",
slices: []setup.SliceKey{
{"test-package", "myslice1"},
{"test-package", "myslice2"},
},
release: map[string]string{
"slices/mydir/test-package.yaml": `
package: test-package
slices:
myslice1:
contents:
/dir/file: {until: mutate}
myslice2:
contents:
/dir/file:
`,
},
filesystem: map[string]string{
"/dir/": "dir 0755",
"/dir/file": "file 0644 cc55e2ec",
},
manifestPaths: map[string]string{
"/dir/file": "file 0644 cc55e2ec {test-package_myslice2}",
},
}, {
summary: "Install two packages, both are recorded",
slices: []setup.SliceKey{
Expand Down
Loading