-
Notifications
You must be signed in to change notification settings - Fork 68
Closed
Description
While implementing WCOW for the containerd snapshotter (containerd/containerd#4419), I bounced off golang/go#26033 in calls to fstest.CheckDirectoryEqualWithApplier and had to work around it rather nastily.
The summary of the issue is that filepath.Walk does not walk through Volume Mount Points (i.e. how a WCOW Layer is mounted to the local filesystem), because Go see it as a symlink, rather than a mount-point (bind, overlay, etc) as you would see on Unix systems for the same behaviour.
There are four approaches I can see to fixing this:
- Hoping Go changes behaviour for mount-points where that mount-point is the "canonical DOS name", i.e. like a non-bind mount, and hence resolves path/filepath: filepath.Walk does not work on mounted volumes in Windows containers golang/go#26033. (And for bind-mount-style mounts, but I assume at some point they chose the current approach of treating Windows bind-mounts as symlinks).
- Keeping the current changes in the containerd tests from my PR, and hoping it passes code-review.
- Implement a Window-specific
PathDriverin containerd's test helpers, which overridesWalk, and either directly recognises volume mounts, or points to a newly-overriddenStatin aDriver, with the latter reporting a volume mount point as a directory, not a symlink. - Same thing, but in continuity as the default on Windows.
- A hybrid:
pathDriverin continuity hasWalkchanged to always callDriver.Lstat, and containerd's test framework can provide a modifiedDriver.Lstat.
This ticket is to ask whether that fourth or fifth options seems reasonable, before I come to creating PRs towards improving this situation; or take option 2 and just work around it.
Metadata
Metadata
Assignees
Labels
No labels