fix lun delete issues
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
parent
5c27e3296d
commit
f849cfae09
|
|
@ -315,6 +315,7 @@ class SynologyHttpClient {
|
|||
method: "map_target",
|
||||
version: "1",
|
||||
});
|
||||
iscsi_target_map.uuid = JSON.stringify(iscsi_target_map.uuid);
|
||||
iscsi_target_map.target_ids = JSON.stringify(iscsi_target_map.target_ids);
|
||||
|
||||
// this is mapping from the perspective of the target
|
||||
|
|
@ -337,25 +338,14 @@ class SynologyHttpClient {
|
|||
method: "delete",
|
||||
version: 1,
|
||||
//uuid: uuid,
|
||||
uuid: "",
|
||||
uuid: JSON.stringify(""),
|
||||
uuids: JSON.stringify([uuid]),
|
||||
//is_soft_feas_ignored: false,
|
||||
is_soft_feas_ignored: true,
|
||||
//feasibility_precheck: true,
|
||||
};
|
||||
|
||||
await this.do_request("GET", "entry.cgi", iscsi_lun_delete);
|
||||
|
||||
// } catch (err) {
|
||||
// /**
|
||||
// * 18990710 = already gone
|
||||
// * LUN_BAD_LUN_UUID = 18990505
|
||||
// * LUN_NO_SUCH_SNAPSHOT = 18990532
|
||||
// *//*
|
||||
// if (![18990505].includes(err.body.error.code)) {
|
||||
// throw err;
|
||||
// }
|
||||
// }
|
||||
// */
|
||||
}
|
||||
|
||||
async CreateSnapshot(data) {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ class ControllerSynologyDriver extends CsiBaseDriver {
|
|||
|
||||
options.service.node.capabilities = options.service.node.capabilities || {};
|
||||
|
||||
const driverResourceType = this.getDriverResourceType();
|
||||
|
||||
if (!("service" in options.service.identity.capabilities)) {
|
||||
this.ctx.logger.debug("setting default identity service caps");
|
||||
|
||||
|
|
@ -69,8 +71,12 @@ class ControllerSynologyDriver extends CsiBaseDriver {
|
|||
//"UNKNOWN",
|
||||
"STAGE_UNSTAGE_VOLUME",
|
||||
"GET_VOLUME_STATS",
|
||||
"EXPAND_VOLUME",
|
||||
//"EXPAND_VOLUME",
|
||||
];
|
||||
|
||||
if (driverResourceType == "volume") {
|
||||
options.service.node.capabilities.rpc.push("EXPAND_VOLUME");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -277,7 +283,7 @@ class ControllerSynologyDriver extends CsiBaseDriver {
|
|||
// create lun
|
||||
data = Object.assign({}, driver.options.iscsi.lunAttributes, {
|
||||
name: iscsiName,
|
||||
location: driver.options.synology.location,
|
||||
location: driver.options.synology.volume,
|
||||
size: capacity_bytes,
|
||||
});
|
||||
let lun_uuid = await httpClient.CreateLun(data);
|
||||
|
|
@ -525,18 +531,13 @@ class ControllerSynologyDriver extends CsiBaseDriver {
|
|||
* @param {*} call
|
||||
*/
|
||||
async GetCapacity(call) {
|
||||
// throw new GrpcError(
|
||||
// grpc.status.UNIMPLEMENTED,
|
||||
// `operation not supported by driver`
|
||||
// );
|
||||
|
||||
const driver = this;
|
||||
const httpClient = await driver.getHttpClient();
|
||||
|
||||
if (!driver.options.synology.location) {
|
||||
if (!driver.options.synology.volume) {
|
||||
throw new GrpcError(
|
||||
grpc.status.FAILED_PRECONDITION,
|
||||
`invalid configuration: missing location`
|
||||
`invalid configuration: missing volume`
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -549,7 +550,7 @@ class ControllerSynologyDriver extends CsiBaseDriver {
|
|||
}
|
||||
|
||||
let response = await httpClient.GetVolumeInfo(
|
||||
driver.options.synology.location
|
||||
driver.options.synology.volume
|
||||
);
|
||||
return { available_capacity: response.body.data.volume.size_free_byte };
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue