improve windows performance with native calls vs powershell calls
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
parent
9a17db5f21
commit
7e2b837428
|
|
@ -2662,10 +2662,10 @@ class CsiBaseDriver {
|
||||||
}
|
}
|
||||||
|
|
||||||
// target path
|
// target path
|
||||||
result = await wutils.GetItem(target_path);
|
result = await filesystem.pathExists(target_path);
|
||||||
// already published
|
// already published
|
||||||
if (result) {
|
if (result) {
|
||||||
if (_.get(result, "LinkType") != "SymbolicLink") {
|
if (!(await filesystem.isSymbolicLink(target_path))) {
|
||||||
throw new GrpcError(
|
throw new GrpcError(
|
||||||
grpc.status.FAILED_PRECONDITION,
|
grpc.status.FAILED_PRECONDITION,
|
||||||
`target path exists but is not a symlink as it should be: ${target_path}`
|
`target path exists but is not a symlink as it should be: ${target_path}`
|
||||||
|
|
@ -2898,12 +2898,12 @@ class CsiBaseDriver {
|
||||||
let win_target_path =
|
let win_target_path =
|
||||||
filesystem.covertUnixSeparatorToWindowsSeparator(target_path);
|
filesystem.covertUnixSeparatorToWindowsSeparator(target_path);
|
||||||
|
|
||||||
result = await wutils.GetItem(win_target_path);
|
result = await filesystem.pathExists(win_target_path);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_.get(result, "LinkType") != "SymbolicLink") {
|
if (!(await filesystem.isSymbolicLink(win_target_path))) {
|
||||||
throw new GrpcError(
|
throw new GrpcError(
|
||||||
grpc.status.FAILED_PRECONDITION,
|
grpc.status.FAILED_PRECONDITION,
|
||||||
`target path is not a symlink ${win_target_path}`
|
`target path is not a symlink ${win_target_path}`
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue