Skip to content

Commit 95fb646

Browse files
committed
linux: accept unmask paths as glob values
That is the same configuration used already by Podman. Signed-off-by: Giuseppe Scrivano <[email protected]>
1 parent 4dcc397 commit 95fb646

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
-13 Bytes
Binary file not shown.

run_linux.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -1233,9 +1233,17 @@ func setupMaskedPaths(g *generate.Generator, opts *define.CommonBuildOptions) {
12331233
if slices.Contains(opts.Unmasks, "all") {
12341234
return
12351235
}
1236+
nextMaskedPath:
12361237
for _, mp := range append(config.DefaultMaskedPaths(), opts.Masks...) {
1237-
if slices.Contains(opts.Unmasks, mp) {
1238-
continue
1238+
for _, unmask := range opts.Unmasks {
1239+
match, err := filepath.Match(unmask, mp)
1240+
if err != nil {
1241+
logrus.Warnf("Invalid unmask pattern %q: %v", unmask, err)
1242+
continue
1243+
}
1244+
if match {
1245+
continue nextMaskedPath
1246+
}
12391247
}
12401248
g.AddLinuxMaskedPaths(mp)
12411249
}

0 commit comments

Comments
 (0)