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
12 changes: 12 additions & 0 deletions internal/setup/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,18 @@ var setupTests = []setupTest{{
`,
},
relerror: `slice mypkg_myslice mutable is not a regular file: /path`,
}, {
summary: "Mutable path cannot have 'until' set to mutate",
input: map[string]string{
"slices/mydir/mypkg.yaml": `
package: mypkg
slices:
myslice:
contents:
/path: {text: data, mutable: true, until: mutate}
`,
},
relerror: `slice mypkg_myslice cannot have both 'mutable' and 'until: mutate' for path /path`,
}, {
summary: "Until checks its value for validity",
input: map[string]string{
Expand Down
3 changes: 3 additions & 0 deletions internal/setup/yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,9 @@ func parsePackage(release *Release, pkgName, pkgPath string, data []byte) (*Pack
if mutable && kinds[0] != TextPath && (kinds[0] != CopyPath || isDir) {
return nil, fmt.Errorf("slice %s_%s mutable is not a regular file: %s", pkg.Name, sliceName, contPath)
}
if mutable && until == UntilMutate {
return nil, fmt.Errorf("slice %s_%s cannot have both 'mutable' and 'until: mutate' for path %s", pkg.Name, sliceName, contPath)
}
slice.Contents[contPath] = PathInfo{
Kind: kinds[0],
Info: info,
Expand Down
Loading