Change globalMapPath to bind mount from symlink

This change is needed to make descriptor lock per pod, in the next commit.
If losetup is called for symlink, path in the output for losetup is resolved,
as a result, we can't distinguish which path the lock is taken.
This commit is contained in:
Masaki Kimura
2019-11-01 19:31:17 +00:00
parent d1e8702d36
commit 2ecdc5e8d1
7 changed files with 246 additions and 84 deletions

View File

@@ -1138,12 +1138,12 @@ type FakeVolumePathHandler struct {
sync.RWMutex
}
func (fv *FakeVolumePathHandler) MapDevice(devicePath string, mapDir string, linkName string) error {
func (fv *FakeVolumePathHandler) MapDevice(devicePath string, mapDir string, linkName string, bindMount bool) error {
// nil is success, else error
return nil
}
func (fv *FakeVolumePathHandler) UnmapDevice(mapDir string, linkName string) error {
func (fv *FakeVolumePathHandler) UnmapDevice(mapDir string, linkName string, bindMount bool) error {
// nil is success, else error
return nil
}
@@ -1158,7 +1158,12 @@ func (fv *FakeVolumePathHandler) IsSymlinkExist(mapPath string) (bool, error) {
return true, nil
}
func (fv *FakeVolumePathHandler) GetDeviceSymlinkRefs(devPath string, mapPath string) ([]string, error) {
func (fv *FakeVolumePathHandler) IsBindMountExist(mapPath string) (bool, error) {
// nil is success, else error
return true, nil
}
func (fv *FakeVolumePathHandler) GetDeviceBindMountRefs(devPath string, mapPath string) ([]string, error) {
// nil is success, else error
return []string{}, nil
}