better handling if missing targetPortal config value
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
parent
8b6e12dd77
commit
ad40b6a1ef
|
|
@ -47,8 +47,9 @@ class ControllerZfsGenericDriver extends ControllerZfsSshBaseDriver {
|
||||||
]
|
]
|
||||||
) {
|
) {
|
||||||
await zb.zfs.set(datasetName, {
|
await zb.zfs.set(datasetName, {
|
||||||
[key]: this.options.nfs.shareStrategySetDatasetProperties
|
[key]:
|
||||||
.properties[key],
|
this.options.nfs.shareStrategySetDatasetProperties
|
||||||
|
.properties[key],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -114,8 +115,10 @@ class ControllerZfsGenericDriver extends ControllerZfsSshBaseDriver {
|
||||||
if (this.options.iscsi.shareStrategyTargetCli.tpg.attributes) {
|
if (this.options.iscsi.shareStrategyTargetCli.tpg.attributes) {
|
||||||
for (const attributeName in this.options.iscsi
|
for (const attributeName in this.options.iscsi
|
||||||
.shareStrategyTargetCli.tpg.attributes) {
|
.shareStrategyTargetCli.tpg.attributes) {
|
||||||
const attributeValue = this.options.iscsi
|
const attributeValue =
|
||||||
.shareStrategyTargetCli.tpg.attributes[attributeName];
|
this.options.iscsi.shareStrategyTargetCli.tpg.attributes[
|
||||||
|
attributeName
|
||||||
|
];
|
||||||
setAttributesText += "\n";
|
setAttributesText += "\n";
|
||||||
setAttributesText += `set attribute ${attributeName}=${attributeValue}`;
|
setAttributesText += `set attribute ${attributeName}=${attributeValue}`;
|
||||||
}
|
}
|
||||||
|
|
@ -124,8 +127,10 @@ class ControllerZfsGenericDriver extends ControllerZfsSshBaseDriver {
|
||||||
if (this.options.iscsi.shareStrategyTargetCli.tpg.auth) {
|
if (this.options.iscsi.shareStrategyTargetCli.tpg.auth) {
|
||||||
for (const attributeName in this.options.iscsi
|
for (const attributeName in this.options.iscsi
|
||||||
.shareStrategyTargetCli.tpg.auth) {
|
.shareStrategyTargetCli.tpg.auth) {
|
||||||
const attributeValue = this.options.iscsi
|
const attributeValue =
|
||||||
.shareStrategyTargetCli.tpg.auth[attributeName];
|
this.options.iscsi.shareStrategyTargetCli.tpg.auth[
|
||||||
|
attributeName
|
||||||
|
];
|
||||||
setAttributesText += "\n";
|
setAttributesText += "\n";
|
||||||
setAttributesText += `set auth ${attributeName}=${attributeValue}`;
|
setAttributesText += `set auth ${attributeName}=${attributeValue}`;
|
||||||
}
|
}
|
||||||
|
|
@ -168,11 +173,11 @@ create /backstores/block/${iscsiName}
|
||||||
|
|
||||||
volume_context = {
|
volume_context = {
|
||||||
node_attach_driver: "iscsi",
|
node_attach_driver: "iscsi",
|
||||||
portal: this.options.iscsi.targetPortal,
|
portal: this.options.iscsi.targetPortal || "",
|
||||||
portals: this.options.iscsi.targetPortals
|
portals: this.options.iscsi.targetPortals
|
||||||
? this.options.iscsi.targetPortals.join(",")
|
? this.options.iscsi.targetPortals.join(",")
|
||||||
: "",
|
: "",
|
||||||
interface: this.options.iscsi.interface,
|
interface: this.options.iscsi.interface || "",
|
||||||
iqn: iqn,
|
iqn: iqn,
|
||||||
lun: 0,
|
lun: 0,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1234,7 +1234,7 @@ class FreeNASDriver extends ControllerZfsSshBaseDriver {
|
||||||
|
|
||||||
volume_context = {
|
volume_context = {
|
||||||
node_attach_driver: "iscsi",
|
node_attach_driver: "iscsi",
|
||||||
portal: this.options.iscsi.targetPortal,
|
portal: this.options.iscsi.targetPortal || "",
|
||||||
portals: this.options.iscsi.targetPortals
|
portals: this.options.iscsi.targetPortals
|
||||||
? this.options.iscsi.targetPortals.join(",")
|
? this.options.iscsi.targetPortals.join(",")
|
||||||
: "",
|
: "",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue