mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-04 13:16:05 +08:00
fix: VM's machine type options is not support (#307)
* feat: get options from API Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com> * feat: add feature flag Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com> * refactor: remove default value Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com> * refactor: fallback to none Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com> --------- Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
This commit is contained in:
@@ -157,6 +157,7 @@ export default {
|
||||
diskRows: [],
|
||||
networkRows: [],
|
||||
machineType: '',
|
||||
machineTypes: [],
|
||||
secretName: '',
|
||||
secretRef: null,
|
||||
showAdvanced: false,
|
||||
@@ -295,6 +296,9 @@ export default {
|
||||
|
||||
async created() {
|
||||
await this.$store.dispatch(`${ this.inStore }/findAll`, { type: SECRET });
|
||||
const machineTypes = this.value.vmMachineTypesFeatureEnabled ? await this.$store.dispatch('harvester/request', { url: '/v1/harvester/clusters/local?link=machineTypes' }) : [''];
|
||||
|
||||
this.machineTypes = machineTypes;
|
||||
this.getInitConfig({ value: this.value, init: this.isCreate });
|
||||
},
|
||||
|
||||
@@ -331,7 +335,8 @@ export default {
|
||||
const maintenanceStrategy = vm.metadata.labels?.[HCI_ANNOTATIONS.VM_MAINTENANCE_MODE_STRATEGY] || 'Migrate';
|
||||
|
||||
const runStrategy = spec.runStrategy || 'RerunOnFailure';
|
||||
const machineType = value.machineType;
|
||||
const machineType = spec.template.spec.domain?.machine?.type || this.machineTypes[0];
|
||||
|
||||
const cpu = spec.template.spec.domain?.cpu?.cores;
|
||||
const memory = spec.template.spec.domain.resources.limits.memory;
|
||||
const reservedMemory = vm.metadata?.annotations?.[HCI_ANNOTATIONS.VM_RESERVED_MEMORY];
|
||||
|
||||
Reference in New Issue
Block a user