From 48a93f6c9c74fec8d9197cbe215955c3ba90c29e Mon Sep 17 00:00:00 2001 From: Francesco Torchia Date: Mon, 11 Nov 2024 16:05:27 +0100 Subject: [PATCH] Implement volumeEncryption feature flag Signed-off-by: Francesco Torchia --- .../index.vue | 13 +++-- .../edit/harvesterhci.io.storage/index.vue | 11 ++-- .../provisioners/driver.longhorn.io_v1.vue | 58 ++++++++++--------- .../harvesterhci.io.virtualmachineimage.vue | 15 ++++- .../VirtualMachineVolume/type/vmImage.vue | 2 +- .../VirtualMachineVolume/type/volume.vue | 2 +- .../harvester/storage.k8s.io.storageclass.js | 8 +++ .../harvesterhci.io.virtualmachineimage.js | 8 ++- .../models/kubevirt.io.virtualmachine.js | 4 ++ 9 files changed, 75 insertions(+), 46 deletions(-) diff --git a/pkg/harvester/detail/harvesterhci.io.virtualmachineimage/index.vue b/pkg/harvester/detail/harvesterhci.io.virtualmachineimage/index.vue index ec8de0e8..3c09ca7d 100644 --- a/pkg/harvester/detail/harvesterhci.io.virtualmachineimage/index.vue +++ b/pkg/harvester/detail/harvesterhci.io.virtualmachineimage/index.vue @@ -29,10 +29,12 @@ export default { }, async fetch() { - const inStore = this.$store.getters['currentProduct'].inStore; + if (this.value.volumeEncryptionFeatureEnabled) { + const inStore = this.$store.getters['currentProduct'].inStore; - this.secrets = await this.$store.dispatch(`${ inStore }/findAll`, { type: SECRET }); - this.images = await this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.IMAGE }); + this.secrets = await this.$store.dispatch(`${ inStore }/findAll`, { type: SECRET }); + this.images = await this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.IMAGE }); + } }, data() { @@ -104,6 +106,7 @@ export default { return this.value.encryptionSecret; }, + secretLink() { return this.secrets.find((sc) => sc.id === this.value.encryptionSecret)?.detailLocation; }, @@ -198,7 +201,7 @@ export default {
@@ -224,7 +227,7 @@ export default {
diff --git a/pkg/harvester/edit/harvesterhci.io.storage/index.vue b/pkg/harvester/edit/harvesterhci.io.storage/index.vue index f512ffe1..f187a316 100644 --- a/pkg/harvester/edit/harvesterhci.io.storage/index.vue +++ b/pkg/harvester/edit/harvesterhci.io.storage/index.vue @@ -126,16 +126,19 @@ export default { const hash = { namespaces: this.$store.dispatch(`${ inStore }/findAll`, { type: NAMESPACE }), - secrets: this.$store.dispatch(`${ inStore }/findAll`, { type: SECRET }), storages: this.$store.dispatch(`${ inStore }/findAll`, { type: STORAGE_CLASS }), longhornNodes: this.$store.dispatch(`${ inStore }/findAll`, { type: LONGHORN.NODES }), csiDrivers: this.$store.dispatch(`${ inStore }/findAll`, { type: CSI_DRIVER }) }; - if (this.longhornV2LVMSupport) { + if (this.value.longhornV2LVMSupport) { hash.longhornV2DataEngine = this.$store.dispatch(`${ inStore }/find`, { type: LONGHORN.SETTINGS, id: LONGHORN_V2_DATA_ENGINE }); } + if (this.value.volumeEncryptionFeatureEnabled) { + hash.secrets = this.$store.dispatch(`${ inStore }/findAll`, { type: SECRET }); + } + await allHash(hash); }, @@ -150,10 +153,6 @@ export default { return this.isCreate ? _CREATE : _VIEW; }, - longhornV2LVMSupport() { - return this.$store.getters['harvester-common/getFeatureEnabled']('longhornV2LVMSupport'); - }, - provisioners() { const out = []; diff --git a/pkg/harvester/edit/harvesterhci.io.storage/provisioners/driver.longhorn.io_v1.vue b/pkg/harvester/edit/harvesterhci.io.storage/provisioners/driver.longhorn.io_v1.vue index 9196603c..94a0fecf 100644 --- a/pkg/harvester/edit/harvesterhci.io.storage/provisioners/driver.longhorn.io_v1.vue +++ b/pkg/harvester/edit/harvesterhci.io.storage/provisioners/driver.longhorn.io_v1.vue @@ -311,37 +311,39 @@ export default {
-
- -
-
- -
-
-
- +
+
-
+
+ +
+
+
+ +
+
+