From fd39fdf173591c366400f77ae9003e53fcfd6899 Mon Sep 17 00:00:00 2001 From: Cody Jackson Date: Fri, 27 Sep 2024 11:37:47 -0700 Subject: [PATCH] Getting the encrypt image workflow to begin working while fixing up some build errors --- .../edit/harvesterhci.io.virtualmachineimage.vue | 8 +++++--- .../VirtualMachinePciDevices/index.vue | 5 +---- pkg/harvester/edit/kubevirt.io.virtualmachine/index.vue | 4 ---- pkg/harvester/models/harvester/secret.js | 1 - .../models/harvesterhci.io.virtualmachineimage.js | 4 ++-- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/pkg/harvester/edit/harvesterhci.io.virtualmachineimage.vue b/pkg/harvester/edit/harvesterhci.io.virtualmachineimage.vue index f38afaf8..6fc661d8 100644 --- a/pkg/harvester/edit/harvesterhci.io.virtualmachineimage.vue +++ b/pkg/harvester/edit/harvesterhci.io.virtualmachineimage.vue @@ -83,10 +83,12 @@ export default { } if (image && cryptoOperation) { + const imageObject = JSON.parse(image); + this.value.spec.securityParameters = { cryptoOperation, - sourceImageName: image.metadata.name, - sourceImageNamespace: image.metadata.namespace + sourceImageName: imageObject.metadata.name, + sourceImageNamespace: imageObject.metadata.namespace } } @@ -95,7 +97,7 @@ export default { } return { - selectedImage: image || null, + selectedImage: null, images: [], url: this.value.spec.url, files: [], diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachinePciDevices/index.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachinePciDevices/index.vue index 71325e1b..ae1a0de8 100644 --- a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachinePciDevices/index.vue +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachinePciDevices/index.vue @@ -3,14 +3,11 @@ import { _EDIT } from '@shell/config/query-params'; import { allHash } from '@shell/utils/promise'; import LabeledSelect from '@shell/components/form/LabeledSelect'; import Banner from '@components/Banner/Banner.vue'; -import CompatibilityMatrix from '../CompatibilityMatrix'; -import DeviceList from './DeviceList'; - import remove from 'lodash/remove'; import { set } from '@shell/utils/object'; import { HCI } from '../../../types'; import DeviceList from './DeviceList'; -import CompatibilityMatrix from './CompatibilityMatrix'; +import CompatibilityMatrix from '../CompatibilityMatrix'; export default { name: 'VirtualMachinePCIDevices', diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/index.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/index.vue index 53360579..c60fc4a0 100644 --- a/pkg/harvester/edit/kubevirt.io.virtualmachine/index.vue +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/index.vue @@ -15,11 +15,8 @@ import Labels from '@shell/components/form/Labels'; import NodeScheduling from '@shell/components/form/NodeScheduling'; import PodAffinity from '@shell/components/form/PodAffinity'; -import AccessCredentials from './VirtualMachineAccessCredentials'; -import PciDevices from './VirtualMachinePciDevices/index'; import VGpuDevices from './VirtualMachineVGpuDevices/index'; import UsbDevices from './VirtualMachineUSBDevices/index'; -import RestartVMDialog from '../../dialog/RestartVMDialog'; import KeyValue from '@shell/components/form/KeyValue'; import { clear } from '@shell/utils/array'; @@ -35,7 +32,6 @@ import { parseVolumeClaimTemplates } from '@pkg/utils/vm'; import VM_MIXIN from '../../mixins/harvester-vm'; import { HCI } from '../../types'; import RestartVMDialog from '../../dialog/RestartVMDialog'; -import VirtualMachineVGpuDevices from './VirtualMachineVGpuDevices/index'; import PciDevices from './VirtualMachinePciDevices/index'; import AccessCredentials from './VirtualMachineAccessCredentials'; import CloudConfig from './VirtualMachineCloudConfig'; diff --git a/pkg/harvester/models/harvester/secret.js b/pkg/harvester/models/harvester/secret.js index 872d1605..febb0a58 100644 --- a/pkg/harvester/models/harvester/secret.js +++ b/pkg/harvester/models/harvester/secret.js @@ -1,5 +1,4 @@ import { clone } from '@shell/utils/object'; -import Secret from '@shell/models/secret'; import { HCI } from '../../types'; import { PRODUCT_NAME as HARVESTER_PRODUCT } from '../../config/harvester'; import Secret from '@shell/models/secret'; diff --git a/pkg/harvester/models/harvesterhci.io.virtualmachineimage.js b/pkg/harvester/models/harvesterhci.io.virtualmachineimage.js index eb2dac17..f7fce9f2 100644 --- a/pkg/harvester/models/harvesterhci.io.virtualmachineimage.js +++ b/pkg/harvester/models/harvesterhci.io.virtualmachineimage.js @@ -88,7 +88,7 @@ export default class HciVmImage extends HarvesterResource { name: `${ HARVESTER_PRODUCT }-c-cluster-resource-create`, params: { resource: HCI.IMAGE }, query: { - image: this, + image: JSON.stringify({metadata: { name: this.metadata.name, namespace: this.metadata.namespace }}), fromPage: HCI.IMAGE, sourceType: 'clone', cryptoOperation: 'encrypt' @@ -103,7 +103,7 @@ export default class HciVmImage extends HarvesterResource { name: `${ HARVESTER_PRODUCT }-c-cluster-resource-create`, params: { resource: HCI.IMAGE }, query: { - image: this, + image: JSON.stringify({metadata: { name: this.metadata.name, namespace: this.metadata.namespace }}), fromPage: HCI.IMAGE, sourceType: 'clone', cryptoOperation: 'decrypt'