Implement volumeEncryption feature flag

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
Francesco Torchia
2024-11-12 11:50:40 +01:00
parent 780106f32a
commit 48a93f6c9c
9 changed files with 75 additions and 46 deletions
@@ -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 = [];
@@ -311,37 +311,39 @@ export default {
</LabeledSelect>
</div>
</div>
<div class="row mt-20">
<RadioGroup
v-model:value="value.parameters.migratable"
name="layer3NetworkMode"
:label="t('harvester.storage.parameters.migratable.label')"
:mode="mode"
:options="migratableOptions"
/>
</div>
<div class="row mt-20">
<RadioGroup
v-model:value="volumeEncryption"
name="volumeEncryption"
:label="t('harvester.storage.volumeEncryption')"
:mode="mode"
:options="volumeEncryptionOptions"
/>
</div>
<div
v-if="value.parameters.encrypted === 'true'"
class="row mt-20"
>
<div class="col span-6">
<LabeledSelect
v-model:value="secret"
:label="t('harvester.storage.secret')"
:options="secretOptions"
<template v-if="value.volumeEncryptionFeatureEnabled">
<div class="row mt-20">
<RadioGroup
v-model:value="value.parameters.migratable"
name="layer3NetworkMode"
:label="t('harvester.storage.parameters.migratable.label')"
:mode="mode"
:options="migratableOptions"
/>
</div>
</div>
<div class="row mt-20">
<RadioGroup
v-model:value="volumeEncryption"
name="volumeEncryption"
:label="t('harvester.storage.volumeEncryption')"
:mode="mode"
:options="volumeEncryptionOptions"
/>
</div>
<div
v-if="value.parameters.encrypted === 'true'"
class="row mt-20"
>
<div class="col span-6">
<LabeledSelect
v-model:value="secret"
:label="t('harvester.storage.secret')"
:options="secretOptions"
:mode="mode"
/>
</div>
</div>
</template>
<KeyValue
v-model:value="parameters"
:add-label="t('storageClass.longhorn.addLabel')"