more minor fixes

Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
Travis Glenn Hansen 2022-05-06 20:37:04 -06:00
parent 910e9d8fca
commit 3d6c26a251
3 changed files with 9 additions and 9 deletions

View File

@ -1318,8 +1318,8 @@ class ControllerZfsBaseDriver extends CsiBaseDriver {
// NOTE: -R will recursively delete items + dependent filesets
// delete dataset
try {
let max_tries = 5;
let sleep_time = 3000;
let max_tries = 12;
let sleep_time = 5000;
let current_try = 1;
let success = false;
while (!success && current_try <= max_tries) {

View File

@ -1261,8 +1261,7 @@ class CsiBaseDriver {
result = await filesystem.pathExists(win_staging_target_path);
if (result) {
result = fs.lstatSync(win_staging_target_path);
if (!result.isSymbolicLink()) {
if (!(await filesystem.isSymbolicLink(win_staging_target_path))) {
fs.rmdirSync(win_staging_target_path);
} else {
result = await wutils.GetItem(win_staging_target_path);
@ -1310,8 +1309,9 @@ class CsiBaseDriver {
if (!details.includes("ResourceExists")) {
throw e;
} else {
result = fs.lstatSync(win_staging_target_path);
if (!result.isSymbolicLink()) {
if (
!(await filesystem.isSymbolicLink(win_staging_target_path))
) {
throw new Error("staging path exists but is not symlink");
}
}
@ -3215,7 +3215,7 @@ class CsiBaseDriver {
filesystem.covertUnixSeparatorToWindowsSeparator(volume_path);
// ensure path is mounted
result = filesystem.pathExists(win_volume_path);
result = await filesystem.pathExists(win_volume_path);
if (!result) {
throw new GrpcError(
grpc.status.NOT_FOUND,
@ -3223,7 +3223,7 @@ class CsiBaseDriver {
);
}
let target = await wutils.GetRealTarget(win_volume_path);
let target = (await wutils.GetRealTarget(win_volume_path)) || "";
if (target.startsWith("\\\\")) {
node_attach_driver = "smb";
}

View File

@ -228,7 +228,7 @@ class Filesystem {
}
}
async isSymboliclink(path) {
async isSymbolicLink(path) {
return fs.lstatSync(path).isSymbolicLink();
}