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:
Travis Glenn Hansen 2021-11-02 15:20:44 -06:00
parent c265e434a5
commit 567ce8545e
2 changed files with 10 additions and 1 deletions

View File

@ -1054,6 +1054,15 @@ class CsiBaseDriver {
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);
// if not mounted, mount
if (!result) {

View File

@ -10,7 +10,7 @@ FINDMNT_COMMON_OPTIONS = [
"--nofsroot", // prevents unwanted behavior with cifs volumes
];
DEFAUT_TIMEOUT = 30000;
DEFAUT_TIMEOUT = process.env.MOUNT_DEFAULT_TIMEOUT || 30000;
class Mount {
constructor(options = {}) {