From dc74441d26fc370808a087e101a4a82259243085 Mon Sep 17 00:00:00 2001 From: Francesco Torchia Date: Wed, 30 Oct 2024 18:53:04 +0100 Subject: [PATCH] Latest changes from Harvester master - d7d9d4af8a88d677695d7aff47a81d52041dfcca Signed-off-by: Francesco Torchia --- pkg/harvester/components/HarvesterUpgrade.vue | 2 +- pkg/harvester/components/Members.vue | 2 - pkg/harvester/components/SettingList.vue | 8 +- .../novnc/NovncConsoleCustomKeys.vue | 11 +- .../components/novnc/NovncConsoleWrapper.vue | 10 +- .../components/settings/csi-driver-config.vue | 2 +- pkg/harvester/config/doc-links.js | 2 +- pkg/harvester/config/harvester-cluster.js | 2 +- pkg/harvester/config/harvester-map.js | 1 + pkg/harvester/config/labels-annotations.js | 1 + pkg/harvester/config/settings.js | 2 +- .../HarvesterHostDisk.vue | 24 +- .../detail/harvesterhci.io.host/index.vue | 3 +- .../dialog/HarvesterMaintenanceDialog.vue | 2 +- .../dialog/HarvesterSupportBundle.vue | 3 + .../harvesterhci.io.host/HarvesterDisk.vue | 229 +++++- .../edit/harvesterhci.io.host/index.vue | 109 +-- .../edit/harvesterhci.io.storage/index.vue | 153 +++- ...ghorn.io.vue => driver.longhorn.io_v1.vue} | 29 +- .../provisioners/driver.longhorn.io_v2.vue | 352 +++++++++ .../lvm.driver.harvesterhci.io.vue | 169 +++++ .../harvesterhci.io.virtualmachineimage.vue | 19 +- ...erhci.io.virtualmachinetemplateversion.vue | 4 +- pkg/harvester/edit/harvesterhci.io.volume.vue | 40 +- .../CompatibilityMatrix.vue | 2 +- .../VirtualMachineVolume/index.vue | 44 +- .../VirtualMachineVolume/type/vmImage.vue | 5 + .../VirtualMachineVolume/type/volume.vue | 37 +- .../edit/kubevirt.io.virtualmachine/index.vue | 4 +- pkg/harvester/l10n/en-us.yaml | 89 ++- .../list/harvesterhci.io.setting.vue | 2 +- .../harvesterhci.io.virtualmachinebackup.vue | 6 +- .../list/harvesterhci.io.vmsnapshot.vue | 2 +- pkg/harvester/list/harvesterhci.io.volume.vue | 5 +- .../list/kubevirt.io.virtualmachine.vue | 5 +- pkg/harvester/mixins/harvester-vm/index.js | 15 +- pkg/harvester/models/harvester/node.js | 2 +- .../models/harvester/persistentvolumeclaim.js | 61 +- .../harvester/storage.k8s.io.storageclass.js | 30 + pkg/harvester/models/harvesterhci.io.addon.js | 5 + .../models/harvesterhci.io.blockdevice.js | 7 +- .../harvesterhci.io.management.cluster.js | 5 +- .../models/kubevirt.io.virtualmachine.js | 38 +- pkg/harvester/types.ts | 1 + scripts/vue-migrate.js | 683 ----------------- vue-migrate.js | 687 ------------------ 46 files changed, 1290 insertions(+), 1624 deletions(-) rename pkg/harvester/edit/harvesterhci.io.storage/provisioners/{driver.longhorn.io.vue => driver.longhorn.io_v1.vue} (90%) create mode 100644 pkg/harvester/edit/harvesterhci.io.storage/provisioners/driver.longhorn.io_v2.vue create mode 100644 pkg/harvester/edit/harvesterhci.io.storage/provisioners/lvm.driver.harvesterhci.io.vue delete mode 100644 scripts/vue-migrate.js delete mode 100644 vue-migrate.js diff --git a/pkg/harvester/components/HarvesterUpgrade.vue b/pkg/harvester/components/HarvesterUpgrade.vue index da4c6c7c..1d76635a 100644 --- a/pkg/harvester/components/HarvesterUpgrade.vue +++ b/pkg/harvester/components/HarvesterUpgrade.vue @@ -206,7 +206,7 @@ export default { {{ errors }} diff --git a/pkg/harvester/components/Members.vue b/pkg/harvester/components/Members.vue index 7538259a..14332594 100644 --- a/pkg/harvester/components/Members.vue +++ b/pkg/harvester/components/Members.vue @@ -6,7 +6,6 @@ import { AGE, ROLE, STATE, PRINCIPAL } from '@shell/config/table-headers'; import Banner from '@components/Banner/Banner.vue'; import Tabbed from '@shell/components/Tabbed/index.vue'; import Tab from '@shell/components/Tabbed/Tab.vue'; -import SortableTable from '@shell/components/SortableTable'; import { mapGetters } from 'vuex'; import { allHash } from '@shell/utils/promise'; @@ -19,7 +18,6 @@ export default { ResourceTable, Tabbed, Tab, - SortableTable }, props: { diff --git a/pkg/harvester/components/SettingList.vue b/pkg/harvester/components/SettingList.vue index d50d1f54..22997b5c 100644 --- a/pkg/harvester/components/SettingList.vue +++ b/pkg/harvester/components/SettingList.vue @@ -124,8 +124,8 @@ export default { Modified - - Technical Preview + + Experimental

@@ -216,9 +216,9 @@ export default { font-size: 12px; } -.technical-preview { +.experimental { margin-left: 10px; - border: 1px solid var(--warning); + border: 1px solid var(--error); border-radius: 5px; padding: 2px 10px; font-size: 12px; diff --git a/pkg/harvester/components/novnc/NovncConsoleCustomKeys.vue b/pkg/harvester/components/novnc/NovncConsoleCustomKeys.vue index b1029835..55eabae3 100644 --- a/pkg/harvester/components/novnc/NovncConsoleCustomKeys.vue +++ b/pkg/harvester/components/novnc/NovncConsoleCustomKeys.vue @@ -7,6 +7,8 @@ import ModalWithCard from '@shell/components/ModalWithCard'; const PREFERED_SHORTCUT_KEYS = 'prefered-shortcut-keys'; export default { + name: 'NovncConsoleCustomKeys', + emits: ['close'], components: { @@ -102,10 +104,6 @@ export default { }, methods: { - show() { - this.$refs.recordShortcutKeys.open(); - }, - closeRecordingModal() { window.removeEventListener('keydown', this.handleShortcut); this.$emit('close'); @@ -172,7 +170,10 @@ export default { - +

diff --git a/pkg/harvester/components/settings/csi-driver-config.vue b/pkg/harvester/components/settings/csi-driver-config.vue index 9c4c5198..c9117356 100644 --- a/pkg/harvester/components/settings/csi-driver-config.vue +++ b/pkg/harvester/components/settings/csi-driver-config.vue @@ -5,7 +5,7 @@ import InfoBox from '@shell/components/InfoBox'; import { allHash } from '@shell/utils/promise'; import { CSI_DRIVER, VOLUME_SNAPSHOT_CLASS } from '../../types'; -const LONGHORN_DRIVER = 'driver.longhorn.io'; +import { LONGHORN_DRIVER } from '@shell/config/types'; export default { name: 'HarvesterCsiDriver', diff --git a/pkg/harvester/config/doc-links.js b/pkg/harvester/config/doc-links.js index d5768932..560428f9 100644 --- a/pkg/harvester/config/doc-links.js +++ b/pkg/harvester/config/doc-links.js @@ -4,7 +4,7 @@ import semver from 'semver'; const docVersion = `v${ semver.major(pkgJson.version) }.${ semver.minor(pkgJson.version) }`; export const DOC_LINKS = { - CONSOLE_URL: `https://docs.harvesterhci.io/${ docVersion }/host/`, + CONSOLE_URL: `https://docs.harvesterhci.io/${ docVersion }/host/#remote-console`, RANCHER_INTEGRATION_URL: `https://docs.harvesterhci.io/${ docVersion }/rancher/rancher-integration`, STORAGE_NETWORK_EXAMPLE: `https://docs.harvesterhci.io/${ docVersion }/advanced/storagenetwork#configuration-example`, KSMTUNED_MODE: `https://docs.harvesterhci.io/${ docVersion }/host/#ksmtuned-mode`, diff --git a/pkg/harvester/config/harvester-cluster.js b/pkg/harvester/config/harvester-cluster.js index d057157f..dc700c98 100644 --- a/pkg/harvester/config/harvester-cluster.js +++ b/pkg/harvester/config/harvester-cluster.js @@ -834,7 +834,7 @@ export function init($plugin, store) { }); virtualType({ - label: 'Addons', + label: 'Add-ons', group: 'advanced', name: HCI.ADD_ONS, ifHaveType: HCI.ADD_ONS, diff --git a/pkg/harvester/config/harvester-map.js b/pkg/harvester/config/harvester-map.js index 39e01ad4..796ad222 100644 --- a/pkg/harvester/config/harvester-map.js +++ b/pkg/harvester/config/harvester-map.js @@ -68,6 +68,7 @@ export const ADD_ONS = { RANCHER_LOGGING: 'rancher-logging', RANCHER_MONITORING: 'rancher-monitoring', VM_IMPORT_CONTROLLER: 'vm-import-controller', + LVM_DRIVER: 'lvm.driver.harvesterhci.io', }; export const CSI_SECRETS = { diff --git a/pkg/harvester/config/labels-annotations.js b/pkg/harvester/config/labels-annotations.js index 5e8d561c..7d31002a 100644 --- a/pkg/harvester/config/labels-annotations.js +++ b/pkg/harvester/config/labels-annotations.js @@ -62,4 +62,5 @@ export const HCI = { CPU_MANAGER: 'cpumanager', VM_DEVICE_ALLOCATION_DETAILS: 'harvesterhci.io/deviceAllocationDetails', SVM_BACKUP_ID: 'harvesterhci.io/svmbackupId', + DISABLE_LONGHORN_V2_ENGINE: 'node.longhorn.io/disable-v2-data-engine', }; diff --git a/pkg/harvester/config/settings.js b/pkg/harvester/config/settings.js index aabdd872..1bec2d45 100644 --- a/pkg/harvester/config/settings.js +++ b/pkg/harvester/config/settings.js @@ -85,7 +85,7 @@ export const HCI_ALLOWED_SETTINGS = { kind: 'json', from: 'import', canReset: true }, [HCI_SETTING.KUBECONFIG_DEFAULT_TOKEN_TTL_MINUTES]: {}, - [HCI_SETTING.LONGHORN_V2_DATA_ENGINE_ENABLED]: { kind: 'boolean', technicalPreview: true }, + [HCI_SETTING.LONGHORN_V2_DATA_ENGINE_ENABLED]: { kind: 'boolean', experimental: true }, [HCI_SETTING.ADDITIONAL_GUEST_MEMORY_OVERHEAD_RATIO]: { kind: 'string', from: 'import' }, }; diff --git a/pkg/harvester/detail/harvesterhci.io.host/HarvesterHostDisk.vue b/pkg/harvester/detail/harvesterhci.io.host/HarvesterHostDisk.vue index f106f953..29c11644 100644 --- a/pkg/harvester/detail/harvesterhci.io.host/HarvesterHostDisk.vue +++ b/pkg/harvester/detail/harvesterhci.io.host/HarvesterHostDisk.vue @@ -6,6 +6,8 @@ import { Banner } from '@components/Banner'; import HarvesterDisk from '../../mixins/harvester-disk'; import { RadioGroup } from '@components/Form/Radio'; +import { LONGHORN_VERSION_V1 } from '@shell/config/types'; + export default { emits: ['update:value'], @@ -86,6 +88,20 @@ export default { return ''; } }, + + provisioner() { + let labelKey = `harvester.host.disk.storage.longhorn.${ LONGHORN_VERSION_V1 }.label`; + + if (this.value?.blockDevice?.spec?.provisioner.longhorn) { + labelKey = `harvester.host.disk.storage.longhorn.${ this.value.blockDevice.spec.provisioner.longhorn.engineVersion }.label`; + } + + if (this.value?.blockDevice?.spec?.provisioner.lvm) { + labelKey = 'harvester.host.disk.storage.lvm.label'; + } + + return this.t(labelKey); + }, }, methods: { update() { @@ -198,12 +214,18 @@ export default { :value="value.displayName" /> -

+
+
+ +
diff --git a/pkg/harvester/detail/harvesterhci.io.host/index.vue b/pkg/harvester/detail/harvesterhci.io.host/index.vue index dbcf299d..ed239772 100644 --- a/pkg/harvester/detail/harvesterhci.io.host/index.vue +++ b/pkg/harvester/detail/harvesterhci.io.host/index.vue @@ -103,11 +103,10 @@ export default { const blockDevices = this.$store.getters[`${ inStore }/all`](HCI.BLOCK_DEVICE); const provisionedBlockDevices = blockDevices.filter((d) => { - const provisioned = d?.spec?.fileSystem?.provisioned; const isCurrentNode = d?.spec?.nodeName === this.value.id; const isLonghornMounted = findBy(this.longhornDisks, 'name', d.metadata.name); - return provisioned && isCurrentNode && !isLonghornMounted; + return d?.isProvisioned && isCurrentNode && !isLonghornMounted; }) .map((d) => { return { diff --git a/pkg/harvester/dialog/HarvesterMaintenanceDialog.vue b/pkg/harvester/dialog/HarvesterMaintenanceDialog.vue index 2b35cc1f..81991bd6 100644 --- a/pkg/harvester/dialog/HarvesterMaintenanceDialog.vue +++ b/pkg/harvester/dialog/HarvesterMaintenanceDialog.vue @@ -125,7 +125,7 @@ export default {
diff --git a/pkg/harvester/dialog/HarvesterSupportBundle.vue b/pkg/harvester/dialog/HarvesterSupportBundle.vue index e187679c..385f0745 100644 --- a/pkg/harvester/dialog/HarvesterSupportBundle.vue +++ b/pkg/harvester/dialog/HarvesterSupportBundle.vue @@ -63,6 +63,7 @@ export default { stringify, close() { + this.isOpen = false; this.$store.commit('harvester-common/toggleBundleModal', false); this.backUpName = ''; }, @@ -109,10 +110,12 @@ export default {

diff --git a/pkg/harvester/edit/harvesterhci.io.host/HarvesterDisk.vue b/pkg/harvester/edit/harvesterhci.io.host/HarvesterDisk.vue index 25ec529f..05e0c574 100644 --- a/pkg/harvester/edit/harvesterhci.io.host/HarvesterDisk.vue +++ b/pkg/harvester/edit/harvesterhci.io.host/HarvesterDisk.vue @@ -1,22 +1,35 @@ + + + diff --git a/pkg/harvester/edit/harvesterhci.io.storage/provisioners/lvm.driver.harvesterhci.io.vue b/pkg/harvester/edit/harvesterhci.io.storage/provisioners/lvm.driver.harvesterhci.io.vue new file mode 100644 index 00000000..2fac3c5c --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.storage/provisioners/lvm.driver.harvesterhci.io.vue @@ -0,0 +1,169 @@ + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.virtualmachineimage.vue b/pkg/harvester/edit/harvesterhci.io.virtualmachineimage.vue index 46804723..fa243017 100644 --- a/pkg/harvester/edit/harvesterhci.io.virtualmachineimage.vue +++ b/pkg/harvester/edit/harvesterhci.io.virtualmachineimage.vue @@ -16,6 +16,7 @@ import { STORAGE_CLASS } from '@shell/config/types'; import { VM_IMAGE_FILE_FORMAT } from '../validators/vm-image'; import { OS } from '../mixins/harvester-vm'; import { HCI } from '../types'; +import { LVM_DRIVER } from '../models/harvester/storage.k8s.io.storageclass'; const ENCRYPT = 'encrypt'; const DECRYPT = 'decrypt'; @@ -138,16 +139,16 @@ export default { const inStore = this.$store.getters['currentProduct'].inStore; const storages = this.$store.getters[`${ inStore }/all`](STORAGE_CLASS); - const out = storages.filter(s => !s.parameters?.backingImage).map((s) => { - const label = s.isDefault ? `${ s.name } (${ this.t('generic.default') })` : s.name; + return storages + .filter(s => !s.parameters?.backingImage && s.provisioner !== LVM_DRIVER) // Lvm storage is not supported. + .map((s) => { + const label = s.isDefault ? `${ s.name } (${ this.t('generic.default') })` : s.name; - return { - label, - value: s.name, - }; - }) || []; - - return out; + return { + label, + value: s.name, + }; + }) || []; }, storageClassName: { diff --git a/pkg/harvester/edit/harvesterhci.io.virtualmachinetemplateversion.vue b/pkg/harvester/edit/harvesterhci.io.virtualmachinetemplateversion.vue index fe1b8645..55126635 100644 --- a/pkg/harvester/edit/harvesterhci.io.virtualmachinetemplateversion.vue +++ b/pkg/harvester/edit/harvesterhci.io.virtualmachinetemplateversion.vue @@ -267,7 +267,7 @@ export default { :label="t('workload.container.titles.nodeScheduling')" :weight="-3" > -