Add WalkCrossDevice option to walk policy

Add the walk policy flag WalkCrossDevice to the fswalker Walk calls. This will avoid potential issues when running in a docker container where a FS tree is made of many overlays. Without the flag set, the Walk operation skips over files on devices that do not match the device at the base path.
This commit is contained in:
Nick
2020-02-14 14:36:15 -08:00
committed by Julio López
parent 8bdd5caf7e
commit 3a5d3179e7
2 changed files with 2 additions and 0 deletions

View File

@@ -65,5 +65,6 @@ func WalkPathHash(ctx context.Context, path string) (*fspb.Walk, error) {
Include: []string{path},
HashPfx: []string{""}, // Hash everything
MaxHashFileSize: MaxFileSizeToHash,
WalkCrossDevice: true,
})
}

View File

@@ -37,6 +37,7 @@ func TestWalk(t *testing.T) {
Include: []string{
dataDir,
},
WalkCrossDevice: true,
})
testenv.AssertNoError(t, err)