sanity check on publish, allow overriding the mount/unmount/findmnt command timeout
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
parent
c265e434a5
commit
567ce8545e
|
|
@ -1054,6 +1054,15 @@ class CsiBaseDriver {
|
||||||
normalized_staging_path = staging_target_path;
|
normalized_staging_path = staging_target_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sanity check to ensure the staged path is actually mounted
|
||||||
|
result = await mount.pathIsMounted(normalized_staging_path);
|
||||||
|
if (!result) {
|
||||||
|
throw new GrpcError(
|
||||||
|
grpc.status.FAILED_PRECONDITION,
|
||||||
|
`staging path is not mounted: ${normalized_staging_path}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
result = await mount.pathIsMounted(target_path);
|
result = await mount.pathIsMounted(target_path);
|
||||||
// if not mounted, mount
|
// if not mounted, mount
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ FINDMNT_COMMON_OPTIONS = [
|
||||||
"--nofsroot", // prevents unwanted behavior with cifs volumes
|
"--nofsroot", // prevents unwanted behavior with cifs volumes
|
||||||
];
|
];
|
||||||
|
|
||||||
DEFAUT_TIMEOUT = 30000;
|
DEFAUT_TIMEOUT = process.env.MOUNT_DEFAULT_TIMEOUT || 30000;
|
||||||
|
|
||||||
class Mount {
|
class Mount {
|
||||||
constructor(options = {}) {
|
constructor(options = {}) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue