mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-08 02:15:27 +00:00
Refactor doBindSubPath into smaller functions:
- getSubpathBindTarget() computes final target of subpath bind-mount. - prepareSubpathTarget() creates target for bind-mount. - safeOpenSubPath() checks symlinks in Subpath and safely opens it.
This commit is contained in:
@@ -1193,10 +1193,6 @@ func TestBindSubPath(t *testing.T) {
|
||||
return nil, "", "", err
|
||||
}
|
||||
|
||||
if err := os.MkdirAll(subpathMount, defaultPerm); err != nil {
|
||||
return nil, "", "", err
|
||||
}
|
||||
|
||||
socketFile, socketCreateError := createSocketFile(volpath)
|
||||
|
||||
return mounts, volpath, socketFile, socketCreateError
|
||||
@@ -1212,10 +1208,6 @@ func TestBindSubPath(t *testing.T) {
|
||||
return nil, "", "", err
|
||||
}
|
||||
|
||||
if err := os.MkdirAll(subpathMount, defaultPerm); err != nil {
|
||||
return nil, "", "", err
|
||||
}
|
||||
|
||||
testFifo := filepath.Join(volpath, "mount_test.fifo")
|
||||
err := syscall.Mkfifo(testFifo, 0)
|
||||
return mounts, volpath, testFifo, err
|
||||
|
||||
Reference in New Issue
Block a user