Merge pull request #76 from democratic-csi/next

remove --force from umount commands due to potential corruption
This commit is contained in:
Travis Glenn Hansen 2021-04-25 20:05:56 -06:00 committed by GitHub
commit 067123943d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,10 @@
# v1.1.3
Release 2021-04-25
- remove `--force` from unmounts
- proper `iqn` logic for rescans
# v1.1.2
Released 2021-04-12

View File

@ -584,6 +584,7 @@ class CsiBaseDriver {
const staging_target_path = call.request.staging_target_path;
const block_path = staging_target_path + "/block_device";
let normalized_staging_path = staging_target_path;
const umount_args = []; // --force
if (!staging_target_path) {
throw new GrpcError(
@ -615,7 +616,7 @@ class CsiBaseDriver {
result = await mount.pathIsMounted(normalized_staging_path);
if (result) {
result = await mount.umount(normalized_staging_path, ["--force"]);
result = await mount.umount(normalized_staging_path, umount_args);
}
if (is_block) {
@ -859,10 +860,11 @@ class CsiBaseDriver {
const volume_id = call.request.volume_id;
const target_path = call.request.target_path;
const umount_args = []; // --force
result = await mount.pathIsMounted(target_path);
if (result) {
result = await mount.umount(target_path, ["--force"]);
result = await mount.umount(target_path, umount_args);
}
result = await filesystem.pathExists(target_path);

View File

@ -156,7 +156,7 @@ class ISCSI {
let session = false;
sessions.every((i_session) => {
if (
`${i_session.iqn}:${i_session.target}` == tgtIQN &&
`${i_session.iqn}` == tgtIQN &&
portal == i_session.portal
) {
session = i_session;
@ -202,8 +202,9 @@ class ISCSI {
id: Number(fields[1].replace("[", "").replace("]", "")),
portal: fields[2].replace("[", "").replace("]", "").split(",")[0],
target_portal_group_tag: fields[2].split(",")[1],
iqn: fields[3].split(":")[0],
target: fields[3].split(":")[1],
iqn: fields[3].trim(),
//iqn: fields[3].split(":")[0],
//target: fields[3].split(":")[1],
});
});