From eb667fd56b2bd45e08ffbb11fd08faf453dd1b2f Mon Sep 17 00:00:00 2001 From: "andy.lee" Date: Wed, 8 Jan 2025 14:41:18 +0800 Subject: [PATCH 01/16] fix: missing label in VM scheduling tab Signed-off-by: andy.lee --- pkg/harvester/mixins/harvester-vm/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/harvester/mixins/harvester-vm/index.js b/pkg/harvester/mixins/harvester-vm/index.js index eae47688..ebe2c1f1 100644 --- a/pkg/harvester/mixins/harvester-vm/index.js +++ b/pkg/harvester/mixins/harvester-vm/index.js @@ -282,14 +282,14 @@ export default { affinityLabels() { return { - namespaceInputLabel: this.t('harvesterManager.affinity.namespaces.label'), + namespaceInputLabel: this.t('harvester.virtualMachine.affinity.namespaces.label'), namespaceSelectionLabels: [ - this.t('harvesterManager.affinity.thisPodNamespace'), + this.t('harvester.virtualMachine.affinity.thisPodNamespace'), this.t('workload.scheduling.affinity.allNamespaces'), - this.t('harvesterManager.affinity.matchExpressions.inNamespaces') + this.t('harvester.virtualMachine.affinity.matchExpressions.inNamespaces') ], - addLabel: this.t('harvesterManager.affinity.addLabel'), - topologyKeyPlaceholder: this.t('harvesterManager.affinity.topologyKey.placeholder') + addLabel: this.t('harvester.affinity.addLabel'), + topologyKeyPlaceholder: this.t('harvester.affinity.topologyKey.placeholder') }; }, }, From 814d296d75e972c44c1721d202f84d068b97f175 Mon Sep 17 00:00:00 2001 From: "andy.lee" Date: Wed, 8 Jan 2025 14:58:30 +0800 Subject: [PATCH 02/16] fix: resume/active scheduling job failed Signed-off-by: andy.lee --- .../models/harvesterhci.io.schedulevmbackup.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pkg/harvester/models/harvesterhci.io.schedulevmbackup.js b/pkg/harvester/models/harvesterhci.io.schedulevmbackup.js index a25483be..758977be 100644 --- a/pkg/harvester/models/harvesterhci.io.schedulevmbackup.js +++ b/pkg/harvester/models/harvesterhci.io.schedulevmbackup.js @@ -1,6 +1,4 @@ import HarvesterResource from './harvester'; -import { get } from '@shell/utils/object'; -import { findBy } from '@shell/utils/array'; import { colorForState, stateDisplay, STATES } from '@shell/plugins/dashboard-store/resource-class'; import { _CREATE } from '@shell/config/query-params'; import { ucFirst, escapeHtml } from '@shell/utils/string'; @@ -67,14 +65,7 @@ export default class ScheduleVmBackup extends HarvesterResource { } get state() { - const conditions = get(this, 'status.conditions'); - const isSuspended = findBy(conditions, 'type', 'BackupSuspend')?.status === 'True'; - - if (isSuspended) { - return STATES.suspended.label; - } - - return this.metadata.state.name; + return this.status?.suspended === true ? STATES.suspended.label : STATES.active.label; } get stateDescription() { From ab71cb377c9d93ce7cc0b3639e6d09275e517f47 Mon Sep 17 00:00:00 2001 From: "andy.lee" Date: Thu, 9 Jan 2025 10:59:49 +0800 Subject: [PATCH 03/16] fix: update translation key Signed-off-by: andy.lee --- pkg/harvester/mixins/harvester-vm/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/harvester/mixins/harvester-vm/index.js b/pkg/harvester/mixins/harvester-vm/index.js index ebe2c1f1..a375de2d 100644 --- a/pkg/harvester/mixins/harvester-vm/index.js +++ b/pkg/harvester/mixins/harvester-vm/index.js @@ -282,7 +282,7 @@ export default { affinityLabels() { return { - namespaceInputLabel: this.t('harvester.virtualMachine.affinity.namespaces.label'), + namespaceInputLabel: this.t('harvester.affinity.namespaces.label'), namespaceSelectionLabels: [ this.t('harvester.virtualMachine.affinity.thisPodNamespace'), this.t('workload.scheduling.affinity.allNamespaces'), From 8b43c200b2d41e22839ab7acfeb9fe92c983b9c5 Mon Sep 17 00:00:00 2001 From: "andy.lee" Date: Thu, 9 Jan 2025 16:13:51 +0800 Subject: [PATCH 04/16] fix: remove translation key Signed-off-by: andy.lee --- pkg/harvester/l10n/en-us.yaml | 15 +++------------ pkg/harvester/mixins/harvester-vm/index.js | 6 +++--- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/pkg/harvester/l10n/en-us.yaml b/pkg/harvester/l10n/en-us.yaml index ffba1efd..db4e5040 100644 --- a/pkg/harvester/l10n/en-us.yaml +++ b/pkg/harvester/l10n/en-us.yaml @@ -742,6 +742,9 @@ harvester: terminationGracePeriodSeconds: label: Termination Grace Period affinity: + addLabel: Add Workload Selector + topologyKey: + placeholder: 'topology.kubernetes.io/zone' thisPodNamespace: This virtual machine's namespace matchExpressions: inNamespaces: "Workloads in these namespaces" @@ -1494,18 +1497,6 @@ harvester: pollingInterval: label: Polling Interval - affinity: - thisPodNamespace: This virtual machine's namespace - matchExpressions: - inNamespaces: "Workloads in these namespaces" - vmAffinityTitle: Virtual Machine Scheduling - namespaces: - placeholder: e.g. default,system,base - label: Namespaces - addLabel: Add Workload Selector - topologyKey: - placeholder: 'topology.kubernetes.io/zone' - advancedSettings: experimental: 'Experimental features allow users to test and evaluate early-access functionality prior to official supported releases' descriptions: diff --git a/pkg/harvester/mixins/harvester-vm/index.js b/pkg/harvester/mixins/harvester-vm/index.js index a375de2d..d04df2bd 100644 --- a/pkg/harvester/mixins/harvester-vm/index.js +++ b/pkg/harvester/mixins/harvester-vm/index.js @@ -282,14 +282,14 @@ export default { affinityLabels() { return { - namespaceInputLabel: this.t('harvester.affinity.namespaces.label'), + namespaceInputLabel: this.t('harvester.virtualMachine.affinity.namespaces.label'), namespaceSelectionLabels: [ this.t('harvester.virtualMachine.affinity.thisPodNamespace'), this.t('workload.scheduling.affinity.allNamespaces'), this.t('harvester.virtualMachine.affinity.matchExpressions.inNamespaces') ], - addLabel: this.t('harvester.affinity.addLabel'), - topologyKeyPlaceholder: this.t('harvester.affinity.topologyKey.placeholder') + addLabel: this.t('harvester.virtualMachine.affinity.addLabel'), + topologyKeyPlaceholder: this.t('harvester.virtualMachine.affinity.topologyKey.placeholder') }; }, }, From 69d7046bc7a3b8d546e34900a9752fd142cc6c77 Mon Sep 17 00:00:00 2001 From: "andy.lee" Date: Thu, 9 Jan 2025 17:13:10 +0800 Subject: [PATCH 05/16] fix: serial console not work Signed-off-by: andy.lee --- pkg/harvester/components/SerialConsole/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/harvester/components/SerialConsole/index.vue b/pkg/harvester/components/SerialConsole/index.vue index 50df6739..69fead2b 100644 --- a/pkg/harvester/components/SerialConsole/index.vue +++ b/pkg/harvester/components/SerialConsole/index.vue @@ -60,7 +60,8 @@ export default { }); this.queue = []; - }, 5) + }, 10), + deep: true } }, From 2a5874555006475180fa419c0ca91af9693143fb Mon Sep 17 00:00:00 2001 From: "andy.lee" Date: Thu, 9 Jan 2025 17:43:19 +0800 Subject: [PATCH 06/16] chore: add v1.5.0 and v1.3.3 feature flags Signed-off-by: andy.lee --- pkg/harvester/config/feature-flags.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/harvester/config/feature-flags.js b/pkg/harvester/config/feature-flags.js index 1b49c719..0787b214 100644 --- a/pkg/harvester/config/feature-flags.js +++ b/pkg/harvester/config/feature-flags.js @@ -17,6 +17,12 @@ const featuresV132 = [ 'improveMaintenanceMode', ]; +// TODO: add v1.3.3 official release note +// https://github.com/harvester/dashboard/releases/tag/v1.3.3-dev-20250105 +const featuresV133 = [ + ...featuresV132, +]; + // https://github.com/harvester/dashboard/releases/tag/v1.4.0 const featuresV140 = [ ...featuresV132, @@ -35,10 +41,17 @@ const featuresV141 = [ ...featuresV140 ]; +// TODO: add v1.5.0 official release note +const featuresV150 = [ + ...featuresV141 +]; + export const RELEASE_FEATURES = { 'v1.3.0': featuresV130, 'v1.3.1': featuresV131, 'v1.3.2': featuresV132, + 'v1.3.3': featuresV133, 'v1.4.0': featuresV140, 'v1.4.1': featuresV141, + 'v1.5.0': featuresV150 }; From c3f266591261d856b5cfc746c30bcde73cba06e9 Mon Sep 17 00:00:00 2001 From: Francesco Torchia Date: Thu, 9 Jan 2025 12:02:55 +0100 Subject: [PATCH 07/16] [porting 1262] Fix vm rows reactivity Signed-off-by: Francesco Torchia --- .../VirtualMachineInstance.vue | 35 ++++++------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/pkg/harvester/detail/harvesterhci.io.host/VirtualMachineInstance.vue b/pkg/harvester/detail/harvesterhci.io.host/VirtualMachineInstance.vue index df02f4a0..7f3d0748 100644 --- a/pkg/harvester/detail/harvesterhci.io.host/VirtualMachineInstance.vue +++ b/pkg/harvester/detail/harvesterhci.io.host/VirtualMachineInstance.vue @@ -24,35 +24,24 @@ export default { }, async fetch() { - const hash = await allHash({ + await allHash({ vms: this.$store.dispatch('harvester/findAll', { type: HCI.VM }), vmis: this.$store.dispatch('harvester/findAll', { type: HCI.VMI }), allClusterNetwork: this.$store.dispatch('harvester/findAll', { type: HCI.CLUSTER_NETWORK }), }); - const instanceMap = {}; - - (hash.vmis || []).forEach((vmi) => { - const vmiUID = vmi?.metadata?.ownerReferences?.[0]?.uid; - - if (vmiUID) { - instanceMap[vmiUID] = vmi; - } - }); - - this.allClusterNetwork = hash.allClusterNetwork; - this.rows = hash.vms.filter((row) => { - return instanceMap[row.metadata?.uid]?.status?.nodeName === this.node?.metadata?.labels?.[HOSTNAME]; - }); - }, - - data() { - return { - rows: [], - allClusterNetwork: [] - }; }, computed: { + allClusterNetwork() { + return this.$store.getters['harvester/all'](HCI.CLUSTER_NETWORK); + }, + + rows() { + const vms = this.$store.getters['harvester/all'](HCI.VM); + + return vms.filter((vm) => vm.vmi?.status?.nodeName === this.node?.metadata?.labels?.[HOSTNAME]); + }, + headers() { return [ STATE, @@ -87,8 +76,6 @@ export default { ]; }, }, - - methods: {} }; From 7e32ea453be28b5f848bff71b133522929c372c8 Mon Sep 17 00:00:00 2001 From: "andy.lee" Date: Fri, 10 Jan 2025 14:37:50 +0800 Subject: [PATCH 08/16] fix: delete VM modal style and wording Signed-off-by: andy.lee --- .../models/kubevirt.io.virtualmachine.js | 4 - .../kubevirt.io.virtualmachine.vue | 77 +++++++++++-------- 2 files changed, 44 insertions(+), 37 deletions(-) diff --git a/pkg/harvester/models/kubevirt.io.virtualmachine.js b/pkg/harvester/models/kubevirt.io.virtualmachine.js index 1d0ea6d6..2e05d306 100644 --- a/pkg/harvester/models/kubevirt.io.virtualmachine.js +++ b/pkg/harvester/models/kubevirt.io.virtualmachine.js @@ -1120,10 +1120,6 @@ export default class VirtVm extends HarvesterResource { return qemu?.status === 'True'; } - get warnDeletionMessage() { - return this.t('harvester.virtualMachine.promptRemove.tips'); - } - get instanceLabels() { const all = this.spec?.template?.metadata?.labels || {}; diff --git a/pkg/harvester/promptRemove/kubevirt.io.virtualmachine.vue b/pkg/harvester/promptRemove/kubevirt.io.virtualmachine.vue index 3ce2a2ae..4ecbae33 100644 --- a/pkg/harvester/promptRemove/kubevirt.io.virtualmachine.vue +++ b/pkg/harvester/promptRemove/kubevirt.io.virtualmachine.vue @@ -4,6 +4,7 @@ import { isEmpty } from '@shell/utils/object'; import Parse from 'url-parse'; import { resourceNames } from '@shell/utils/string'; import { HCI } from '../types'; +import { alternateLabel as alternateLabelButton } from '@shell/utils/platform'; export default { name: 'HarvesterPromptRemove', @@ -39,8 +40,9 @@ export default { data() { return { - checkedList: [], - checkAll: true + checkedList: [], + checkAll: true, + alternateLabel: alternateLabelButton }; }, @@ -138,44 +140,53 @@ export default { From 811635801142961905cf273bbba1a6186b399b44 Mon Sep 17 00:00:00 2001 From: "andy.lee" Date: Mon, 13 Jan 2025 14:13:00 +0800 Subject: [PATCH 09/16] fix: resume schedule job error Signed-off-by: andy.lee --- pkg/harvester/models/harvesterhci.io.schedulevmbackup.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/harvester/models/harvesterhci.io.schedulevmbackup.js b/pkg/harvester/models/harvesterhci.io.schedulevmbackup.js index 758977be..7fedea76 100644 --- a/pkg/harvester/models/harvesterhci.io.schedulevmbackup.js +++ b/pkg/harvester/models/harvesterhci.io.schedulevmbackup.js @@ -64,6 +64,10 @@ export default class ScheduleVmBackup extends HarvesterResource { } } + get stateObj() { + return this?.metadata?.state || {}; + } + get state() { return this.status?.suspended === true ? STATES.suspended.label : STATES.active.label; } From 57ab9e2830950a63c25960863dba844cd4610ee3 Mon Sep 17 00:00:00 2001 From: "andy.lee" Date: Mon, 13 Jan 2025 16:07:32 +0800 Subject: [PATCH 10/16] fix: filter schedule style and functionality Signed-off-by: andy.lee --- pkg/harvester/components/FilterVMSchedule.vue | 32 +++++++++++-------- .../list/harvesterhci.io.vmsnapshot.vue | 2 ++ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/pkg/harvester/components/FilterVMSchedule.vue b/pkg/harvester/components/FilterVMSchedule.vue index e8570401..a64675e2 100644 --- a/pkg/harvester/components/FilterVMSchedule.vue +++ b/pkg/harvester/components/FilterVMSchedule.vue @@ -64,22 +64,22 @@ export default { @@ -106,6 +106,12 @@ export default { + +