P.metadata.name === this.value.volumeName );
},
+ storageClasses() {
+ return this.$store.getters['harvester/all'](STORAGE_CLASS) || [];
+ },
+
+ isShareableCapable() {
+ const pvcSpec = this.pvcResource?.spec;
+
+ if (!pvcSpec) {
+ return false;
+ }
+
+ const isRWX = (pvcSpec.accessModes || []).includes('ReadWriteMany');
+ const isBlock = pvcSpec.volumeMode === VOLUME_MODE.BLOCK;
+ const storageClass = this.storageClasses.find((sc) => sc.name === pvcSpec.storageClassName);
+
+ // fail closed: without a resolved StorageClass the provisioner
+ // requirement cannot be evaluated
+ if (!storageClass) {
+ return false;
+ }
+
+ return isRWX && isBlock && storageClass.provisioner !== LONGHORN_DRIVER;
+ },
+
volumeOption() {
return sortBy(
this.allPVCs
@@ -145,6 +171,7 @@ export default {
this.value.size = pvcResource.spec.resources.requests.storage;
this.value.storageClassName = pvcResource.spec.storageClassName;
this.value.volumeMode = pvcResource.spec.volumeMode;
+ this.value.shareable = false;
this.update();
},
@@ -155,6 +182,13 @@ export default {
}
},
+ isShareableCapable(neu) {
+ if (!neu && this.value.shareable) {
+ this.value.shareable = false;
+ this.update();
+ }
+ },
+
pvcResource: {
handler(pvc) {
if (!this.value.volumeName && pvc?.metadata?.name) {
@@ -303,6 +337,26 @@ export default {
/>
+
+
+
+
{
+ if (disk.shareable && !disks.find((D) => D.name === disk.name)?.shareable) {
+ delete disk.shareable;
+ }
+ });
+
let spec = {
...this.spec,
runStrategy: this.runStrategy,
@@ -1253,6 +1262,10 @@ export default {
out.cdrom = { bus: R.bus };
}
+ if (R.shareable) {
+ out.shareable = true;
+ }
+
out.bootOrder = index + 1;
return out;