mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-01 03:36:04 +08:00
Change isKVMDisable condition (#294)
* change condition to check isKVMDisable Signed-off-by: Andy Lee <andy.lee@suse.com> * change condition eq 0 Signed-off-by: Andy Lee <andy.lee@suse.com> * add allNotExist back Signed-off-by: Andy Lee <andy.lee@suse.com> --------- Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
@@ -185,9 +185,16 @@ export default class HciNode extends HarvesterResource {
|
||||
}
|
||||
|
||||
get isKVMDisable() {
|
||||
// Arm based
|
||||
const isARMMachine = this.metadata.labels?.[HCI_ANNOTATIONS.K8S_ARCH]?.includes('arm');
|
||||
|
||||
if (isARMMachine) {
|
||||
return this.status.capacity['devices.kubevirt.io/kvm'] && this.status.capacity['devices.kubevirt.io/kvm'] === '0';
|
||||
}
|
||||
|
||||
const allNotExist = !this.metadata?.labels?.[HCI_ANNOTATIONS.KVM_AMD_CPU] && !this.metadata?.labels?.[HCI_ANNOTATIONS.KVM_INTEL_CPU];
|
||||
|
||||
return this.metadata?.labels?.[HCI_ANNOTATIONS.KVM_AMD_CPU] === 'false' || this.metadata?.labels?.[HCI_ANNOTATIONS.KVM_INTEL_CPU] === 'false' || allNotExist;
|
||||
return allNotExist || this.metadata?.labels?.[HCI_ANNOTATIONS.KVM_AMD_CPU] === 'false' || this.metadata?.labels?.[HCI_ANNOTATIONS.KVM_INTEL_CPU] === 'false';
|
||||
}
|
||||
|
||||
get stateDisplay() {
|
||||
|
||||
Reference in New Issue
Block a user