Merge pull request #242 from Random-Liu/follow-symlink-for-mount

Follow symlink for mount host path.
This commit is contained in:
Lantao Liu 2017-09-12 11:17:31 -07:00 committed by GitHub
commit 5b44da76e8

View File

@ -495,6 +495,12 @@ func addOCIBindMounts(g *generate.Generator, mounts []*runtime.Mount, mountLabel
return fmt.Errorf("failed to mkdir %q: %v", src, err)
}
}
// TODO(random-liu): Add cri-containerd integration test or cri validation test
// for this.
src, err := resolveSymbolicLink(src)
if err != nil {
return fmt.Errorf("failed to resolve symlink %q: %v", src, err)
}
options := []string{"rbind"}
switch mount.GetPropagation() {
case runtime.MountPropagation_PROPAGATION_PRIVATE: