Skip to content

Commit 84e7502

Browse files
committed
check: adapt to work with ForceMask
Signed-off-by: Giuseppe Scrivano <[email protected]>
1 parent b78a599 commit 84e7502

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

check.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ type CheckOptions struct {
8080
// layer to the contents that we'd expect it to have to ignore certain
8181
// discrepancies
8282
type checkIgnore struct {
83-
ownership, timestamps, permissions bool
83+
ownership, timestamps, permissions, filetype bool
8484
}
8585

8686
// CheckMost returns a CheckOptions with mostly just "quick" checks enabled.
@@ -139,8 +139,10 @@ func (s *store) Check(options *CheckOptions) (CheckReport, error) {
139139
if strings.Contains(o, "ignore_chown_errors=true") {
140140
ignore.ownership = true
141141
}
142-
if strings.HasPrefix(o, "force_mask=") {
142+
if strings.Contains(o, "force_mask=") {
143+
ignore.ownership = true
143144
ignore.permissions = true
145+
ignore.filetype = true
144146
}
145147
}
146148
for o := range s.pullOptions {
@@ -833,7 +835,7 @@ func (s *store) Repair(report CheckReport, options *RepairOptions) []error {
833835
// compareFileInfo returns a string summarizing what's different between the two checkFileInfos
834836
func compareFileInfo(a, b checkFileInfo, idmap *idtools.IDMappings, ignore checkIgnore) string {
835837
var comparison []string
836-
if a.typeflag != b.typeflag {
838+
if a.typeflag != b.typeflag && !ignore.filetype {
837839
comparison = append(comparison, fmt.Sprintf("filetype:%v→%v", a.typeflag, b.typeflag))
838840
}
839841
if idmap != nil && !idmap.Empty() {

0 commit comments

Comments
 (0)