diff --git a/pkg/harvester/dialog/HarvesterAddHotplugModal.vue b/pkg/harvester/dialog/HarvesterAddHotplugModal.vue index cc3bcf24..accf9394 100644 --- a/pkg/harvester/dialog/HarvesterAddHotplugModal.vue +++ b/pkg/harvester/dialog/HarvesterAddHotplugModal.vue @@ -57,6 +57,10 @@ export default { if (!!pvc.metadata?.annotations?.[HCI_ANNOTATIONS.IMAGE_ID]) { return false; } + // we won't show golden image volume in the hot plug volume modal + if (pvc.isGoldenImageVolume) { + return false; + } return !pvc.attachVM; }) diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/existing.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/existing.vue index 45182470..802b4e9b 100644 --- a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/existing.vue +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/existing.vue @@ -111,7 +111,7 @@ export default { return false; } - if (pvc.metadata?.annotations?.[HCI_ANNOTATIONS.GOLDEN_IMAGE] === 'true') { + if (pvc.isGoldenImageVolume) { return false; } diff --git a/pkg/harvester/list/harvesterhci.io.volume.vue b/pkg/harvester/list/harvesterhci.io.volume.vue index d878e85e..b7b3ebfc 100644 --- a/pkg/harvester/list/harvesterhci.io.volume.vue +++ b/pkg/harvester/list/harvesterhci.io.volume.vue @@ -6,10 +6,8 @@ import { } from '@shell/config/types'; import { STATE, AGE, NAME, NAMESPACE } from '@shell/config/table-headers'; import HarvesterVolumeState from '../formatters/HarvesterVolumeState'; - import { allSettled } from '../utils/promise'; import { HCI, VOLUME_SNAPSHOT } from '../types'; -import { HCI as HCI_ANNOTATIONS } from '@pkg/harvester/config/labels-annotations'; const schema = { id: HCI.VOLUME, @@ -72,7 +70,7 @@ export default { }, filterRows() { // we only show the non golden image PVCs in the list - return this.rows.filter((pvc) => pvc?.metadata?.annotations?.[HCI_ANNOTATIONS.GOLDEN_IMAGE] !== 'true'); + return this.rows.filter((pvc) => !pvc?.isGoldenImageVolume); }, headers() { return [ diff --git a/pkg/harvester/models/harvester/persistentvolumeclaim.js b/pkg/harvester/models/harvester/persistentvolumeclaim.js index c245c626..ff7f8d81 100644 --- a/pkg/harvester/models/harvester/persistentvolumeclaim.js +++ b/pkg/harvester/models/harvester/persistentvolumeclaim.js @@ -344,6 +344,10 @@ export default class HciPv extends HarvesterResource { return this.dataEngine === DATA_ENGINE_V2; } + get isGoldenImageVolume() { + return this?.metadata?.annotations?.[HCI_ANNOTATIONS.GOLDEN_IMAGE] === 'true'; + } + get thirdPartyStorageFeatureEnabled() { return this.$rootGetters['harvester-common/getFeatureEnabled']('thirdPartyStorage'); }