Compare commits

..
Author SHA1 Message Date
Andy Lee c61d30a607 Merge pull request #141 from harvester/mergify/bp/release-harvester-v1.5/pr-140
update yarn.lock (backport #140)
2025-02-17 12:15:56 +08:00
andy.lee 9428a07850 update yarn.lock
Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit 9d02623b3a)
2025-02-17 04:14:24 +00:00
Andy Lee 28603d3ab3 Merge pull request #139 from harvester/mergify/bp/release-harvester-v1.5/pr-138
fix: Harvester ui extension not working built from CI (backport #138)
2025-02-17 12:13:35 +08:00
Yi-Ya Chen f863b881a9 feat: fix $ctx redefine issue
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
(cherry picked from commit cbe66f4660)
2025-02-17 03:57:25 +00:00
Andy Lee 083ab9f3e9 Merge pull request #136 from harvester/mergify/bp/release-harvester-v1.5/pr-134
Move harvester schema.js into harvester folder (backport #134)
2025-02-14 13:33:29 +08:00
Andy Lee 5d52c368a1 Merge pull request #137 from harvester/mergify/bp/release-harvester-v1.5/pr-133
Upgrade @rancher/shell to v3.0.2-rc3 (backport #133)
2025-02-14 13:33:18 +08:00
andy.lee d72f379ab1 upgrade @rancher/shell to v3.0.2-rc3
Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit 0153f9d985)
2025-02-14 05:30:40 +00:00
andy.lee 2931248fdb move harvester schema.js into harvester folder
Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit 548bdd2835)
2025-02-14 05:30:24 +00:00
Yiya Chen 7166a5b1bb Merge pull request #135 from harvester/mergify/bp/release-harvester-v1.5/pr-132
feat: add EFI persistent state checkbox in VM advanced tab (backport #132)
2025-02-14 09:14:42 +08:00
Yi-Ya Chen 00c884cda0 lint: fix eslint
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
(cherry picked from commit 70a56c75b0)
2025-02-13 10:04:33 +00:00
Yi-Ya Chen 1c65b71e35 refactor: remove persistent property if unchecked
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
(cherry picked from commit 31a9abd5c2)
2025-02-13 10:04:33 +00:00
Yi-Ya Chen 3e4bc31a9d fix: state not update when the TPM checkbox is toggled
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
(cherry picked from commit 6d5139a994)
2025-02-13 10:04:32 +00:00
Yi-Ya Chen bc4bbd9a40 feat: add efi persistent state
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
(cherry picked from commit b92f22fa75)
2025-02-13 10:04:32 +00:00
Yiya Chen a6666ef384 Merge pull request #131 from harvester/mergify/bp/release-harvester-v1.5/pr-128
feat: improve Single-Replica Volume Detection for Upgrade (backport #128)
2025-02-12 10:52:50 +08:00
Yi-Ya Chen 92588c9adc refactor: fix conflicts
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
2025-02-12 09:35:21 +08:00
Yi-Ya Chen 832df26efc feat: add divider
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
(cherry picked from commit 3b054b35c6)
2025-02-12 01:10:53 +00:00
Yi-Ya Chen f7869cb241 refactor: align key spacing
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
(cherry picked from commit fd3f5ec1e6)
2025-02-12 01:10:53 +00:00
Yi-Ya Chen 27c0124682 feat: add feature flag
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
(cherry picked from commit 72c6741af1)

# Conflicts:
#	pkg/harvester/config/feature-flags.js
2025-02-12 01:10:52 +00:00
Yi-Ya Chen 6c69579c41 feat: add checkbox to skip checking
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
(cherry picked from commit 375127a78a)
2025-02-12 01:10:52 +00:00
Andy Lee 145b534c5d Merge pull request #130 from harvester/mergify/bp/release-harvester-v1.5/pr-127
fix: unable to create new sshkey in VM create page (backport #127)
2025-02-11 17:36:50 +08:00
andy.lee ce017a0e40 fix: unable to create new sshkey in VM create page
Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit 176946e5e9)
2025-02-11 09:30:37 +00:00
Andy Lee 72a6f77fd2 Merge pull request #129 from harvester/mergify/bp/release-harvester-v1.5/pr-119
Add VlanL2Network / UntaggedNetwork types in network-storage setting (backport #119)
2025-02-11 17:29:20 +08:00
andy.lee 275b15ad62 update feature flag
Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit fc09e030a0)
2025-02-11 09:18:03 +00:00
andy.lee 06c9a8b3d9 extract network_type to config/types
Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit 5f76da4629)
2025-02-11 09:18:02 +00:00
andy.lee 36b1406738 fix number of IP formula
Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit 3a3122f3a1)
2025-02-11 09:18:02 +00:00
andy.lee 06b13a9cc5 add network type in storage-network setting
Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit 229cbf1f69)
2025-02-11 09:18:01 +00:00
Andy Lee 2a3cd32447 Merge pull request #126 from harvester/mergify/bp/release-harvester-v1.5/pr-125
fix: vGPU number not correct (backport #125)
2025-02-11 13:17:51 +08:00
andy.lee 40dc31226b fix: vGPU number not correct
Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit 26afffc2f1)
2025-02-11 05:13:50 +00:00
Andy Lee def9e1a24e Merge pull request #124 from harvester/mergify/bp/release-harvester-v1.5/pr-121
The hints on the branding page is using the wrong product name (backport #121)
2025-02-11 11:45:16 +08:00
andy.lee da25b28f7f remove unneeded translation keys
Signed-off-by: andy.lee <andy.lee@suse.com>
2025-02-11 11:39:48 +08:00
Volker Theile 10abbd0452 The hints on the branding page is using the wrong product name
The hints on the `Branding` page at `Advanced > Settings > UI > branding` are using the product name `Rancher` instead of `Harvester`.

Related to: https://github.com/harvester/harvester/issues/6341

Signed-off-by: Volker Theile <vtheile@suse.com>
(cherry picked from commit d023fa1de4)
2025-02-11 03:25:22 +00:00
Andy Lee 8a7cc69a69 Merge pull request #123 from harvester/mergify/bp/release-harvester-v1.5/pr-122
fix: isEncrypted breaks all the volume page (backport #122)
2025-02-11 11:21:42 +08:00
andy.lee c188f3367d fix: isEncrypted breaks all the volume page
Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit 2232e56ba1)
2025-02-11 03:20:33 +00:00
Andy Lee 26d85a7760 Merge pull request #120 from harvester/mergify/bp/release-harvester-v1.5/pr-117
feat: add support for persistent TPM in VMs (backport #117)
2025-02-11 10:36:45 +08:00
Yi-Ya Chen 6eb845b46b refactor: update feature flag
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
(cherry picked from commit 1651e201e8)
2025-02-11 02:28:10 +00:00
Yi-Ya Chen 8c20ddb440 feat: add feature flag
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
(cherry picked from commit 43b30ec3c3)
2025-02-11 02:28:10 +00:00
Yi-Ya Chen a92f27d80c refactor: rewrite render logic
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
(cherry picked from commit 68ba934b5a)
2025-02-11 02:28:09 +00:00
Yi-Ya Chen f523a161b6 feat: add checkbox to create templates
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
(cherry picked from commit 84bacfaff5)
2025-02-11 02:28:09 +00:00
Yi-Ya Chen ad2273b5ba feat: add persistent state checkbox
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
(cherry picked from commit e8017e14c8)
2025-02-11 02:28:09 +00:00
Andy Lee 171939e66b Merge pull request #118 from harvester/mergify/bp/release-harvester-v1.5/pr-116
Fix unable to add/delete new hard disk in edit node page (backport #116)
2025-02-07 11:32:08 +08:00
andy.lee 18bfbbaac1 fix unable to add/delete new hard disk
Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit cbb66175f6)
2025-02-07 03:23:49 +00:00
Andy Lee e79f493cb6 Merge pull request #114 from harvester/mergify/bp/release-harvester-v1.5/pr-13
align CPU pinning checkbox position in cloud template (backport #13)
2025-02-06 14:36:03 +08:00
andy.lee e84c0fe886 align CPU pinning checkbox position in cloud template
(cherry picked from commit 59bf735f8b)
2025-02-06 14:23:12 +08:00
Andy Lee bbfeb55af9 Merge pull request #113 from harvester/mergify/bp/release-harvester-v1.5/pr-110
Prevent display lock icon if this.volumes is empty array (backport #110)
2025-02-06 12:25:26 +08:00
andy.lee e7446e7e23 prevent display icon if this.volumes is empty array
Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit c75755a527)
2025-02-06 03:48:41 +00:00
Andy Lee adacaf65fa Merge pull request #111 from harvester/mergify/bp/release-harvester-v1.5/pr-109
Add v1.4.2 feature flag to v1.5 branch (backport #109)
2025-02-06 11:47:13 +08:00
andy.lee 7c761b2829 add v1.4.2 feature flag
Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit e8f282395e)
2025-02-05 09:45:46 +00:00
Andy Lee cc8532ff99 Merge pull request #108 from harvester/mergify/bp/release-harvester-v1.5/pr-107
upgrade @rancher/shell to v3.0.2-rc2 (backport #107)
2025-02-05 12:34:11 +08:00
andy.lee ede281a42d upgrade @rancher/shell to v3.0.2-rc2
Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit 426e15084e)
2025-02-05 04:32:14 +00:00
27 changed files with 1847 additions and 1125 deletions

No files matched your search

+3 -2
View File
@@ -6,13 +6,14 @@
"node": ">=20.0.0" "node": ">=20.0.0"
}, },
"dependencies": { "dependencies": {
"@rancher/shell": "3.0.1-rc.4", "@rancher/shell": "3.0.2-rc.3",
"cache-loader": "^4.1.0", "cache-loader": "^4.1.0",
"color": "4.2.3", "color": "4.2.3",
"ip": "2.0.1", "ip": "2.0.1",
"node-polyfill-webpack-plugin": "^3.0.0", "node-polyfill-webpack-plugin": "^3.0.0",
"vue-draggable-next": "^2.2.1", "vue-draggable-next": "^2.2.1",
"yaml": "^2.5.1" "yaml": "^2.5.1",
"@babel/plugin-transform-class-static-block": "7.26.0"
}, },
"resolutions": { "resolutions": {
"@types/node": "~20.10.0", "@types/node": "~20.10.0",
+9 -1
View File
@@ -1 +1,9 @@
module.exports = require('@rancher/shell/pkg/babel.config'); const baseConfig = require('@rancher/shell/pkg/babel.config');
module.exports = {
...baseConfig,
plugins: [
...(baseConfig.plugins || []),
'@babel/plugin-transform-class-static-block'
]
};
+35 -8
View File
@@ -5,8 +5,10 @@ import { Checkbox } from '@components/Form/Checkbox';
import ModalWithCard from '@shell/components/ModalWithCard'; import ModalWithCard from '@shell/components/ModalWithCard';
import LabeledSelect from '@shell/components/form/LabeledSelect'; import LabeledSelect from '@shell/components/form/LabeledSelect';
import { Banner } from '@components/Banner'; import { Banner } from '@components/Banner';
import { HCI as HCI_ANNOTATIONS } from '@pkg/harvester/config/labels-annotations';
import { HCI } from '../types'; import { HCI } from '../types';
import UpgradeInfo from './UpgradeInfo'; import UpgradeInfo from './UpgradeInfo';
export default { export default {
name: 'HarvesterUpgrade', name: 'HarvesterUpgrade',
@@ -28,14 +30,15 @@ export default {
data() { data() {
return { return {
upgrade: [], upgrade: [],
upgradeMessage: [], upgradeMessage: [],
errors: '', errors: '',
selectMode: true, selectMode: true,
version: '', version: '',
enableLogging: true, enableLogging: true,
readyReleaseNote: false, skipSingleReplicaDetachedVol: false,
isOpen: false readyReleaseNote: false,
isOpen: false
}; };
}, },
@@ -68,6 +71,10 @@ export default {
return this.$store.getters['harvester/schemaFor'](HCI.UPGRADE_LOG); return this.$store.getters['harvester/schemaFor'](HCI.UPGRADE_LOG);
}, },
skipSingleReplicaDetachedVolFeatureEnabled() {
return this.$store.getters['harvester-common/getFeatureEnabled']('skipSingleReplicaDetachedVol');
},
releaseLink() { releaseLink() {
return `https://github.com/harvester/harvester/releases/tag/${ this.version }`; return `https://github.com/harvester/harvester/releases/tag/${ this.version }`;
} }
@@ -104,6 +111,11 @@ export default {
spec: { version: this.version } spec: { version: this.version }
}; };
if (this.skipSingleReplicaDetachedVolFeatureEnabled && this.skipSingleReplicaDetachedVol) {
upgradeValue.metadata.annotations =
{ [HCI_ANNOTATIONS.SKIP_SINGLE_REPLICA_DETACHED_VOL]: JSON.stringify(this.skipSingleReplicaDetachedVol) };
}
if (this.canEnableLogging) { if (this.canEnableLogging) {
upgradeValue.spec.logEnabled = this.enableLogging; upgradeValue.spec.logEnabled = this.enableLogging;
} }
@@ -190,6 +202,21 @@ export default {
/> />
</div> </div>
<div
v-if="skipSingleReplicaDetachedVolFeatureEnabled"
class="mb-5"
>
<Checkbox
v-model:value="skipSingleReplicaDetachedVol"
class="check"
type="checkbox"
:label="t('harvester.upgradePage.skipSingleReplicaDetachedVol')"
/>
</div>
<hr
v-if="version"
class="divider"
/>
<div v-if="version"> <div v-if="version">
<p <p
v-clean-html="t('harvester.upgradePage.releaseTip', {url: releaseLink}, true)" v-clean-html="t('harvester.upgradePage.releaseTip', {url: releaseLink}, true)"
@@ -12,6 +12,9 @@ import { NODE } from '@shell/config/types';
import { HCI } from '../../types'; import { HCI } from '../../types';
import { DOC } from '../../config/doc-links'; import { DOC } from '../../config/doc-links';
import { docLink } from '../../utils/feature-flags'; import { docLink } from '../../utils/feature-flags';
import { NETWORK_TYPE } from '../../config/types';
const { L2VLAN, UNTAGGED } = NETWORK_TYPE;
export default { export default {
name: 'HarvesterEditStorageNetwork', name: 'HarvesterEditStorageNetwork',
@@ -57,11 +60,14 @@ export default {
data() { data() {
let parsedDefaultValue = {}; let parsedDefaultValue = {};
let openVlan = false; let openVlan = false;
let networkType = L2VLAN;
try { try {
parsedDefaultValue = JSON.parse(this.value.value); parsedDefaultValue = JSON.parse(this.value.value);
networkType = 'vlan' in parsedDefaultValue ? L2VLAN : UNTAGGED; // backend doesn't provide networkType, so we check if vlan is provided instead
openVlan = true; openVlan = true;
} catch (error) { } catch (error) {
networkType = L2VLAN;
parsedDefaultValue = { parsedDefaultValue = {
vlan: '', vlan: '',
clusterNetwork: '', clusterNetwork: '',
@@ -73,6 +79,7 @@ export default {
return { return {
openVlan, openVlan,
networkType,
errors: [], errors: [],
exclude, exclude,
parsedDefaultValue, parsedDefaultValue,
@@ -87,16 +94,35 @@ export default {
}, },
computed: { computed: {
showVlan() {
return this.networkType === L2VLAN;
},
networkTypes() {
const types = [L2VLAN];
if (this.untaggedNetworkSettingEnabled) {
types.push(UNTAGGED);
}
return types;
},
storageNetworkExampleLink() { storageNetworkExampleLink() {
const version = this.$store.getters['harvester-common/getServerVersion'](); const version = this.$store.getters['harvester-common/getServerVersion']();
return docLink(DOC.STORAGE_NETWORK_EXAMPLE, version); return docLink(DOC.STORAGE_NETWORK_EXAMPLE, version);
}, },
untaggedNetworkSettingEnabled() {
return this.$store.getters['harvester-common/getFeatureEnabled']('untaggedNetworkSetting');
},
clusterNetworkOptions() { clusterNetworkOptions() {
const inStore = this.$store.getters['currentProduct'].inStore; const inStore = this.$store.getters['currentProduct'].inStore;
const clusterNetworks = this.$store.getters[`${ inStore }/all`](HCI.CLUSTER_NETWORK) || []; const clusterNetworks = this.$store.getters[`${ inStore }/all`](HCI.CLUSTER_NETWORK) || [];
// untaggedNetwork filter out mgmt cluster network
const clusterNetworksOptions = this.networkType === UNTAGGED ? clusterNetworks.filter((net) => net.id !== 'mgmt') : clusterNetworks;
return clusterNetworks.map((n) => { return clusterNetworksOptions.map((n) => {
const disabled = !n.isReadyForStorageNetwork; const disabled = !n.isReadyForStorageNetwork;
return { return {
@@ -108,7 +134,50 @@ export default {
}, },
}, },
watch: {
networkType: {
handler(neu) {
this.parsedDefaultValue.clusterNetwork = '';
if (neu === L2VLAN) {
this.parsedDefaultValue.vlan = '';
} else {
delete this.parsedDefaultValue.vlan;
}
},
deep: true
}
},
methods: { methods: {
inputVlan(neu) {
if (neu === '') {
this.parsedDefaultValue.vlan = '';
return;
}
const newValue = Number(neu);
if (newValue > 4094) {
this.parsedDefaultValue.vlan = 4094;
} else if (newValue < 1) {
this.parsedDefaultValue.vlan = 1;
} else {
this.parsedDefaultValue.vlan = newValue;
}
},
useDefault() {
this.openVlan = false;
this.networkType = L2VLAN;
this.parsedDefaultValue = {
vlan: '',
clusterNetwork: '',
range: '',
exclude: []
};
},
update() { update() {
const exclude = this.exclude.filter((ip) => ip); const exclude = this.exclude.filter((ip) => ip);
@@ -138,7 +207,7 @@ export default {
errors.push(this.t('harvester.setting.storageNetwork.range.invalid', null, true)); errors.push(this.t('harvester.setting.storageNetwork.range.invalid', null, true));
} }
if (!this.parsedDefaultValue.vlan) { if (this.networkType === L2VLAN && !this.parsedDefaultValue.vlan) {
errors.push(this.t('validation.required', { key: this.t('harvester.setting.storageNetwork.vlan') }, true)); errors.push(this.t('validation.required', { key: this.t('harvester.setting.storageNetwork.vlan') }, true));
} }
@@ -191,13 +260,25 @@ export default {
/> />
<div v-if="openVlan"> <div v-if="openVlan">
<LabeledSelect
v-model:value="networkType"
class="mb-20"
:options="networkTypes"
:mode="mode"
:label="t('harvester.fields.type')"
required
/>
<LabeledInput <LabeledInput
v-if="showVlan"
v-model:value.number="parsedDefaultValue.vlan" v-model:value.number="parsedDefaultValue.vlan"
type="number" type="number"
class="mb-20" class="mb-20"
:mode="mode" :mode="mode"
required required
placeholder="e.g. 1 - 4094"
label-key="harvester.setting.storageNetwork.vlan" label-key="harvester.setting.storageNetwork.vlan"
@update:value="inputVlan"
/> />
<LabeledSelect <LabeledSelect
+13 -4
View File
@@ -25,7 +25,7 @@ const featuresV133 = [
// https://github.com/harvester/dashboard/releases/tag/v1.4.0 // https://github.com/harvester/dashboard/releases/tag/v1.4.0
const featuresV140 = [ const featuresV140 = [
...featuresV132, ...featuresV133,
'cpuPinning', 'cpuPinning',
'usbPassthrough', 'usbPassthrough',
'volumeEncryption', 'volumeEncryption',
@@ -35,15 +35,23 @@ const featuresV140 = [
'improveMaintenanceMode', 'improveMaintenanceMode',
]; ];
// TODO: add v1.4.1 official release note // https://github.com/harvester/dashboard/releases/tag/v1.4.1
// https://github.com/harvester/dashboard/releases/tag/v1.4.1-rc1
const featuresV141 = [ const featuresV141 = [
...featuresV140 ...featuresV140
]; ];
// TODO: add v1.4.2 official release note
const featuresV142 = [
...featuresV141
];
// TODO: add v1.5.0 official release note // TODO: add v1.5.0 official release note
const featuresV150 = [ const featuresV150 = [
...featuresV141 ...featuresV142,
'tpmPersistentState',
'efiPersistentState',
'untaggedNetworkSetting',
'skipSingleReplicaDetachedVol'
]; ];
export const RELEASE_FEATURES = { export const RELEASE_FEATURES = {
@@ -53,5 +61,6 @@ export const RELEASE_FEATURES = {
'v1.3.3': featuresV133, 'v1.3.3': featuresV133,
'v1.4.0': featuresV140, 'v1.4.0': featuresV140,
'v1.4.1': featuresV141, 'v1.4.1': featuresV141,
'v1.4.2': featuresV142,
'v1.5.0': featuresV150 'v1.5.0': featuresV150
}; };
+57 -56
View File
@@ -7,60 +7,61 @@ export const LABELS_TO_IGNORE_REGEX = [
]; ];
export const HCI = { export const HCI = {
CLOUD_INIT: 'harvesterhci.io/cloud-init-template', CLOUD_INIT: 'harvesterhci.io/cloud-init-template',
CURRENT_IP: 'rke2.io/internal-ip', CURRENT_IP: 'rke2.io/internal-ip',
IMAGE_ID: 'harvesterhci.io/imageId', IMAGE_ID: 'harvesterhci.io/imageId',
SSH_NAMES: 'harvesterhci.io/sshNames', SSH_NAMES: 'harvesterhci.io/sshNames',
NETWORK_IPS: 'network.harvesterhci.io/ips', NETWORK_IPS: 'network.harvesterhci.io/ips',
TEMPLATE_VERSION_CUSTOM_NAME: 'template-version.harvesterhci.io/customName', TEMPLATE_VERSION_CUSTOM_NAME: 'template-version.harvesterhci.io/customName',
CREATOR: 'harvesterhci.io/creator', CREATOR: 'harvesterhci.io/creator',
OS: 'harvesterhci.io/os', OS: 'harvesterhci.io/os',
NETWORK_TYPE: 'network.harvesterhci.io/type', NETWORK_TYPE: 'network.harvesterhci.io/type',
VM_NAME: 'harvesterhci.io/vmName', VM_NAME: 'harvesterhci.io/vmName',
VM_NAME_PREFIX: 'harvesterhci.io/vmNamePrefix', VM_NAME_PREFIX: 'harvesterhci.io/vmNamePrefix',
VM_RESERVED_MEMORY: 'harvesterhci.io/reservedMemory', VM_RESERVED_MEMORY: 'harvesterhci.io/reservedMemory',
MAINTENANCE_STATUS: 'harvesterhci.io/maintain-status', MAINTENANCE_STATUS: 'harvesterhci.io/maintain-status',
HOST_CUSTOM_NAME: 'harvesterhci.io/host-custom-name', HOST_CUSTOM_NAME: 'harvesterhci.io/host-custom-name',
HOST_CONSOLE_URL: 'harvesterhci.io/host-console-url', HOST_CONSOLE_URL: 'harvesterhci.io/host-console-url',
RESTORE_NAME: 'restore.harvesterhci.io/name', RESTORE_NAME: 'restore.harvesterhci.io/name',
NODE_ROLE_MASTER: 'node-role.kubernetes.io/master', NODE_ROLE_MASTER: 'node-role.kubernetes.io/master',
NODE_ROLE_CONTROL_PLANE: 'node-role.kubernetes.io/control-plane', NODE_ROLE_CONTROL_PLANE: 'node-role.kubernetes.io/control-plane',
NODE_ROLE_ETCD: 'node-role.harvesterhci.io/witness', NODE_ROLE_ETCD: 'node-role.harvesterhci.io/witness',
PROMOTE_STATUS: 'harvesterhci.io/promote-status', PROMOTE_STATUS: 'harvesterhci.io/promote-status',
MIGRATION_STATE: 'harvesterhci.io/migrationState', MIGRATION_STATE: 'harvesterhci.io/migrationState',
VOLUME_CLAIM_TEMPLATE: 'harvesterhci.io/volumeClaimTemplates', VOLUME_CLAIM_TEMPLATE: 'harvesterhci.io/volumeClaimTemplates',
IMAGE_NAME: 'harvesterhci.io/image-name', IMAGE_NAME: 'harvesterhci.io/image-name',
INIT_IP: 'etcd.rke2.cattle.io/node-address', INIT_IP: 'etcd.rke2.cattle.io/node-address',
NODE_SCHEDULABLE: 'kubevirt.io/schedulable', NODE_SCHEDULABLE: 'kubevirt.io/schedulable',
NETWORK_ROUTE: 'network.harvesterhci.io/route', NETWORK_ROUTE: 'network.harvesterhci.io/route',
MATCHED_NODES: 'network.harvesterhci.io/matched-nodes', MATCHED_NODES: 'network.harvesterhci.io/matched-nodes',
OS_UPGRADE_IMAGE: 'harvesterhci.io/os-upgrade-image', OS_UPGRADE_IMAGE: 'harvesterhci.io/os-upgrade-image',
LATEST_UPGRADE: 'harvesterhci.io/latestUpgrade', LATEST_UPGRADE: 'harvesterhci.io/latestUpgrade',
UPGRADE_STATE: 'harvesterhci.io/upgradeState', UPGRADE_STATE: 'harvesterhci.io/upgradeState',
REAY_MESSAGE: 'harvesterhci.io/read-message', REAY_MESSAGE: 'harvesterhci.io/read-message',
DYNAMIC_SSHKEYS_NAMES: 'harvesterhci.io/dynamic-ssh-key-names', DYNAMIC_SSHKEYS_NAMES: 'harvesterhci.io/dynamic-ssh-key-names',
DYNAMIC_SSHKEYS_USERS: 'harvesterhci.io/dynamic-ssh-key-users', DYNAMIC_SSHKEYS_USERS: 'harvesterhci.io/dynamic-ssh-key-users',
IMAGE_SUFFIX: 'harvesterhci.io/image-type', IMAGE_SUFFIX: 'harvesterhci.io/image-type',
OS_TYPE: 'harvesterhci.io/os-type', OS_TYPE: 'harvesterhci.io/os-type',
STORAGE_PROVISIONER: 'harvesterhci.io/storageProvisioner', STORAGE_PROVISIONER: 'harvesterhci.io/storageProvisioner',
HOST_REQUEST: 'management.cattle.io/pod-requests', SKIP_SINGLE_REPLICA_DETACHED_VOL: 'harvesterhci.io/skipSingleReplicaDetachedVol',
STORAGE_CLASS: 'harvesterhci.io/storageClassName', HOST_REQUEST: 'management.cattle.io/pod-requests',
STORAGE_NETWORK: 'storage-network.settings.harvesterhci.io', STORAGE_CLASS: 'harvesterhci.io/storageClassName',
ADDON_EXPERIMENTAL: 'addon.harvesterhci.io/experimental', STORAGE_NETWORK: 'storage-network.settings.harvesterhci.io',
VOLUME_ERROR: 'longhorn.io/volume-scheduling-error', ADDON_EXPERIMENTAL: 'addon.harvesterhci.io/experimental',
KVM_AMD_CPU: 'cpu-feature.node.kubevirt.io/svm', VOLUME_ERROR: 'longhorn.io/volume-scheduling-error',
KVM_INTEL_CPU: 'cpu-feature.node.kubevirt.io/vmx', KVM_AMD_CPU: 'cpu-feature.node.kubevirt.io/svm',
NODE_MANUFACTURER: 'manufacturer', KVM_INTEL_CPU: 'cpu-feature.node.kubevirt.io/vmx',
NODE_MODEL: 'model', NODE_MANUFACTURER: 'manufacturer',
NODE_SERIAL_NUMBER: 'serialNumber', NODE_MODEL: 'model',
VM_INSUFFICIENT: 'harvesterhci.io/insufficient-resource-quota', NODE_SERIAL_NUMBER: 'serialNumber',
NODE_NTP_SYNC_STATUS: 'node.harvesterhci.io/ntp-service', VM_INSUFFICIENT: 'harvesterhci.io/insufficient-resource-quota',
PARENT_SRIOV: 'harvesterhci.io/parent-sriov-network-device', NODE_NTP_SYNC_STATUS: 'node.harvesterhci.io/ntp-service',
PARENT_SRIOV_GPU: 'harvesterhci.io/parentSRIOVGPUDevice', PARENT_SRIOV: 'harvesterhci.io/parent-sriov-network-device',
VM_MAINTENANCE_MODE_STRATEGY: 'harvesterhci.io/maintain-mode-strategy', PARENT_SRIOV_GPU: 'harvesterhci.io/parentSRIOVGPUDevice',
NODE_CPU_MANAGER_UPDATE_STATUS: 'harvesterhci.io/cpu-manager-update-status', VM_MAINTENANCE_MODE_STRATEGY: 'harvesterhci.io/maintain-mode-strategy',
CPU_MANAGER: 'cpumanager', NODE_CPU_MANAGER_UPDATE_STATUS: 'harvesterhci.io/cpu-manager-update-status',
VM_DEVICE_ALLOCATION_DETAILS: 'harvesterhci.io/deviceAllocationDetails', CPU_MANAGER: 'cpumanager',
SVM_BACKUP_ID: 'harvesterhci.io/svmbackupId', VM_DEVICE_ALLOCATION_DETAILS: 'harvesterhci.io/deviceAllocationDetails',
DISABLE_LONGHORN_V2_ENGINE: 'node.longhorn.io/disable-v2-data-engine', SVM_BACKUP_ID: 'harvesterhci.io/svmbackupId',
DISABLE_LONGHORN_V2_ENGINE: 'node.longhorn.io/disable-v2-data-engine',
}; };
+3 -1
View File
@@ -65,7 +65,9 @@ export const HCI_ALLOWED_SETTINGS = {
[HCI_SETTING.SUPPORT_BUNDLE_EXPIRATION]: {}, [HCI_SETTING.SUPPORT_BUNDLE_EXPIRATION]: {},
[HCI_SETTING.SUPPORT_BUNDLE_NODE_COLLECTION_TIMEOUT]: { featureFlag: 'supportBundleNodeCollectionTimeoutSetting' }, [HCI_SETTING.SUPPORT_BUNDLE_NODE_COLLECTION_TIMEOUT]: { featureFlag: 'supportBundleNodeCollectionTimeoutSetting' },
[HCI_SETTING.SUPPORT_BUNDLE_IMAGE]: { kind: 'json', from: 'import' }, [HCI_SETTING.SUPPORT_BUNDLE_IMAGE]: { kind: 'json', from: 'import' },
[HCI_SETTING.STORAGE_NETWORK]: { kind: 'custom', from: 'import' }, [HCI_SETTING.STORAGE_NETWORK]: {
kind: 'custom', from: 'import', canReset: true
},
[HCI_SETTING.VM_FORCE_RESET_POLICY]: { kind: 'json', from: 'import' }, [HCI_SETTING.VM_FORCE_RESET_POLICY]: { kind: 'json', from: 'import' },
[HCI_SETTING.SSL_CERTIFICATES]: { kind: 'json', from: 'import' }, [HCI_SETTING.SSL_CERTIFICATES]: { kind: 'json', from: 'import' },
[HCI_SETTING.SSL_PARAMETERS]: { [HCI_SETTING.SSL_PARAMETERS]: {
+5
View File
@@ -2,3 +2,8 @@ export const BACKUP_TYPE = {
BACKUP: 'backup', BACKUP: 'backup',
SNAPSHOT: 'snapshot' SNAPSHOT: 'snapshot'
}; };
export const NETWORK_TYPE = {
L2VLAN: 'L2VlanNetwork',
UNTAGGED: 'UntaggedNetwork'
};
@@ -11,6 +11,9 @@ import { HCI as HCI_LABELS_ANNOTATIONS } from '@pkg/harvester/config/labels-anno
import CreateEditView from '@shell/mixins/create-edit-view'; import CreateEditView from '@shell/mixins/create-edit-view';
import { allHash } from '@shell/utils/promise'; import { allHash } from '@shell/utils/promise';
import { HCI } from '../types'; import { HCI } from '../types';
import { NETWORK_TYPE } from '../config/types';
const { L2VLAN, UNTAGGED } = NETWORK_TYPE;
const AUTO = 'auto'; const AUTO = 'auto';
const MANUAL = 'manual'; const MANUAL = 'manual';
@@ -48,7 +51,7 @@ export default {
config.bridge = config.bridge.slice(0, -3); config.bridge = config.bridge.slice(0, -3);
} }
const type = this.value.vlanType || 'L2VlanNetwork' ; const type = this.value.vlanType || L2VLAN ;
return { return {
config, config,
@@ -101,15 +104,15 @@ export default {
}, },
networkType() { networkType() {
return ['L2VlanNetwork', 'UntaggedNetwork']; return [L2VLAN, UNTAGGED];
}, },
isUntaggedNetwork() { isUntaggedNetwork() {
if (this.isView) { if (this.isView) {
return this.value.vlanType === 'UntaggedNetwork'; return this.value.vlanType === UNTAGGED;
} }
return this.type === 'UntaggedNetwork'; return this.type === UNTAGGED;
} }
}, },
@@ -434,7 +434,7 @@ export default {
<div class="spacer"></div> <div class="spacer"></div>
<Checkbox <Checkbox
v-if="value.cpuPinningFeatureEnabled" v-if="value.cpuPinningFeatureEnabled"
v-model="cpuPinning" v-model:value="cpuPinning"
class="check" class="check"
type="checkbox" type="checkbox"
tooltip-key="harvester.virtualMachine.cpuPinning.tooltip" tooltip-key="harvester.virtualMachine.cpuPinning.tooltip"
@@ -465,11 +465,29 @@ export default {
:mode="mode" :mode="mode"
/> />
<Checkbox
v-if="value.tpmPersistentStateFeatureEnabled && tpmEnabled"
v-model:value="tpmPersistentStateEnabled"
class="check"
type="checkbox"
:label="t('harvester.virtualMachine.advancedOptions.tpmPersistentState')"
:mode="mode"
/>
<Checkbox <Checkbox
v-model:value="efiEnabled" v-model:value="efiEnabled"
class="check" class="check"
type="checkbox" type="checkbox"
:label="t('harvester.virtualMachine.efiEnabled')" :label="t('harvester.virtualMachine.advancedOptions.efiEnabled')"
:mode="mode"
/>
<Checkbox
v-if="value.efiPersistentStateFeatureEnabled && efiEnabled"
v-model:value="efiPersistentStateEnabled"
class="check"
type="checkbox"
:label="t('harvester.virtualMachine.advancedOptions.efiPersistentState')"
:mode="mode" :mode="mode"
/> />
@@ -478,7 +496,7 @@ export default {
v-model:value="secureBoot" v-model:value="secureBoot"
class="check" class="check"
type="checkbox" type="checkbox"
:label="t('harvester.virtualMachine.secureBoot')" :label="t('harvester.virtualMachine.advancedOptions.secureBoot')"
:mode="mode" :mode="mode"
/> />
</Tab> </Tab>
@@ -249,7 +249,7 @@ export default {
:searchable="searchable" :searchable="searchable"
:disabled="disabled" :disabled="disabled"
:options="sshOption" :options="sshOption"
@update:value="update" @input="update"
/> />
<ModalWithCard <ModalWithCard
@@ -46,10 +46,13 @@ export default {
this[key] = res[key]; this[key] = res[key];
} }
uniq([ const vGpus = this.vm.isOff ? [
...(this.value?.domain?.devices?.gpus || []).map(({ name }) => name), ...(this.value?.domain?.devices?.gpus || []).map(({ name }) => name),
] : [
...Object.values(this.vm?.provisionedVGpus).reduce((acc, gpus) => [...acc, ...gpus], []) ...Object.values(this.vm?.provisionedVGpus).reduce((acc, gpus) => [...acc, ...gpus], [])
]).forEach((name) => { ];
uniq(vGpus).forEach((name) => {
if (this.enabledDevices.find((device) => device?.metadata?.name === name)) { if (this.enabledDevices.find((device) => device?.metadata?.name === name)) {
this.selectedDevices.push(name); this.selectedDevices.push(name);
} }
@@ -873,11 +873,29 @@ export default {
:mode="mode" :mode="mode"
/> />
<Checkbox
v-if="value.tpmPersistentStateFeatureEnabled && tpmEnabled"
v-model:value="tpmPersistentStateEnabled"
class="check"
type="checkbox"
:label="t('harvester.virtualMachine.advancedOptions.tpmPersistentState')"
:mode="mode"
/>
<Checkbox <Checkbox
v-model:value="efiEnabled" v-model:value="efiEnabled"
class="check" class="check"
type="checkbox" type="checkbox"
:label="t('harvester.virtualMachine.efiEnabled')" :label="t('harvester.virtualMachine.advancedOptions.efiEnabled')"
:mode="mode"
/>
<Checkbox
v-if="value.efiPersistentStateFeatureEnabled && efiEnabled"
v-model:value="efiPersistentStateEnabled"
class="check"
type="checkbox"
:label="t('harvester.virtualMachine.advancedOptions.efiPersistentState')"
:mode="mode" :mode="mode"
/> />
@@ -886,9 +904,10 @@ export default {
v-model:value="secureBoot" v-model:value="secureBoot"
class="check" class="check"
type="checkbox" type="checkbox"
:label="t('harvester.virtualMachine.secureBoot')" :label="t('harvester.virtualMachine.advancedOptions.secureBoot')"
:mode="mode" :mode="mode"
/> />
<Banner <Banner
v-if="showCpuPinningBanner" v-if="showCpuPinningBanner"
color="warning" color="warning"
@@ -58,7 +58,7 @@ export default {
const out = []; const out = [];
blockDevices.map((b) => { blockDevices.map((b) => {
if (b.metadata.state.error) { if (b?.metadata?.state?.error) {
out.push(b.metadata.state.message); out.push(b.metadata.state.message);
} }
}); });
+19 -3
View File
@@ -54,6 +54,11 @@ dialog:
message: "Are you sure you want to continue pause the {type} {names}?" message: "Are you sure you want to continue pause the {type} {names}?"
harvester: harvester:
branding:
logos:
tip: 'Upload a logo to replace the Harvester logo in the top-level navigation header. Image height should be 21 pixels with a max width of 200 pixels. Max file size is 20KB. Accepted formats: JPEG, PNG, SVG.'
favicon:
tip: 'Upload an icon to replace the Harvester favicon in the browser tab. Max file size is 20KB'
productLabel: 'Harvester' productLabel: 'Harvester'
modal: modal:
backup: backup:
@@ -594,15 +599,17 @@ harvester:
enableUsb: Enable USB Tablet enableUsb: Enable USB Tablet
advancedOptions: advancedOptions:
tpm: Enable TPM tpm: Enable TPM
tpmPersistentState: TPM Persistent State
cpuManager: cpuManager:
prefix: You must enable CPU Manager for at least one node in prefix: You must enable CPU Manager for at least one node in
middle: 'host page' middle: 'host page'
suffix: to enable CPU Pinning for VM suffix: to enable CPU Pinning for VM
efiEnabled: Booting in EFI mode
efiPersistentState: EFI Persistent State
secureBoot: Secure Boot
usbTip: Provides an absolute pointer device which often helps with getting a consistent mouse cursor position in VNC. usbTip: Provides an absolute pointer device which often helps with getting a consistent mouse cursor position in VNC.
sshTitle: Add Public SSH Key sshTitle: Add Public SSH Key
imageTip: An external URL to the .iso, .img, .qcow2 or .raw that the virtual machine should be created from. imageTip: An external URL to the .iso, .img, .qcow2 or .raw that the virtual machine should be created from.
efiEnabled: Booting in EFI mode
secureBoot: Secure Boot
volume: volume:
dragTip: Drag and drop volumes, or use the volume's arrows, to change the boot order. dragTip: Drag and drop volumes, or use the volume's arrows, to change the boot order.
volumeTip: The virtual machine only contains a CD-ROM volume. You may want to add additional disk volumes. volumeTip: The virtual machine only contains a CD-ROM volume. You may want to add additional disk volumes.
@@ -848,6 +855,7 @@ harvester:
currentVersion: CURRENT VERSION currentVersion: CURRENT VERSION
versionLabel: AVAILABLE COMPATIBLE VERSIONS versionLabel: AVAILABLE COMPATIBLE VERSIONS
enableLogging: Enable Logging enableLogging: Enable Logging
skipSingleReplicaDetachedVol: Skip checking single-replica detached volumes
upgradeNode: Upgrading Node upgradeNode: Upgrading Node
upgradeSysService: Upgrading System Service upgradeSysService: Upgrading System Service
upgradeImage: Download Upgrade Image upgradeImage: Download Upgrade Image
@@ -1021,7 +1029,7 @@ harvester:
invalid: '"Exclude list" is invalid.' invalid: '"Exclude list" is invalid.'
addIp: Add Exclude IP addIp: Add Exclude IP
warning: 'WARNING: <br/> Any change to storage-network requires shutting down all virtual machines before applying this setting. <br/> Users have to ensure the cluster network is configured and VLAN Configuration will cover all nodes and ensure the network connectivity is working and expected in all nodes.' warning: 'WARNING: <br/> Any change to storage-network requires shutting down all virtual machines before applying this setting. <br/> Users have to ensure the cluster network is configured and VLAN Configuration will cover all nodes and ensure the network connectivity is working and expected in all nodes.'
tip: 'Specify an IP range in the IPv4 CIDR format. <code>Number of IPs Required = Number of Nodes * 4 + Number of Disks * 2 + Number of Images to Download/Upload </code>. For more information about storage network settings, see the <a href="{url}" target="_blank">documentation</a>.' tip: 'Specify an IP range in the IPv4 CIDR format. <code>Number of IPs Required = Number of Nodes * 2 + Number of Disks * 2 + Number of Images to Download/Upload </code>. For more information about storage network settings, see the <a href="{url}" target="_blank">documentation</a>.'
vmForceDeletionPolicy: vmForceDeletionPolicy:
period: Period period: Period
ratio : Ratio ratio : Ratio
@@ -1512,6 +1520,14 @@ harvester:
pollingInterval: pollingInterval:
label: Polling Interval label: Polling Interval
typeDescription:
# Map of
# type: Description to be shown on the top of list view describing the type.
# Should fit on one line.
# If you link to anything external, it MUST have
# target="_blank" rel="noopener noreferrer nofollow"
harvester: "Branding allows administrators to globally re-brand the UI by customizing the Harvester product name, logos and color scheme."
advancedSettings: advancedSettings:
experimental: 'Experimental features allow users to test and evaluate early-access functionality prior to official supported releases' experimental: 'Experimental features allow users to test and evaluate early-access functionality prior to official supported releases'
descriptions: descriptions:
@@ -101,7 +101,7 @@ export default {
v-bind="$attrs" v-bind="$attrs"
:headers="headers" :headers="headers"
:sub-rows="true" :sub-rows="true"
:groupable="false" :groupable="true"
:rows="rows" :rows="rows"
:group-title-by="groupTitleBy" :group-title-by="groupTitleBy"
:group-by="groupBy" :group-by="groupBy"
+9 -1
View File
@@ -137,7 +137,15 @@ export default {
}, },
isTpmEnabled(spec) { isTpmEnabled(spec) {
return !!spec?.template?.spec?.domain?.devices?.tpm ; return !!spec?.template?.spec?.domain?.devices?.tpm;
},
isTPMPersistentStateEnabled(spec) {
return !!spec?.template?.spec?.domain?.devices?.tpm?.persistent;
},
isEFIPersistentStateEnabled(spec) {
return !!spec?.template?.spec?.domain?.firmware?.bootloader?.efi?.persistent;
}, },
isSecureBoot(spec) { isSecureBoot(spec) {
+44 -14
View File
@@ -164,6 +164,8 @@ export default {
accessCredentials: [], accessCredentials: [],
efiEnabled: false, efiEnabled: false,
tpmEnabled: false, tpmEnabled: false,
tpmPersistentStateEnabled: false,
efiPersistentStateEnabled: false,
secureBoot: false, secureBoot: false,
userDataTemplateId: '', userDataTemplateId: '',
saveUserDataAsClearText: false, saveUserDataAsClearText: false,
@@ -367,6 +369,8 @@ export default {
const installAgent = this.hasInstallAgent(userData, osType, true); const installAgent = this.hasInstallAgent(userData, osType, true);
const efiEnabled = this.isEfiEnabled(spec); const efiEnabled = this.isEfiEnabled(spec);
const tpmEnabled = this.isTpmEnabled(spec); const tpmEnabled = this.isTpmEnabled(spec);
const tpmPersistentStateEnabled = this.isTPMPersistentStateEnabled(spec);
const efiPersistentStateEnabled = this.isEFIPersistentStateEnabled(spec);
const secureBoot = this.isSecureBoot(spec); const secureBoot = this.isSecureBoot(spec);
const cpuPinning = this.isCpuPinning(spec); const cpuPinning = this.isCpuPinning(spec);
@@ -398,7 +402,9 @@ export default {
this['installUSBTablet'] = installUSBTablet; this['installUSBTablet'] = installUSBTablet;
this['efiEnabled'] = efiEnabled; this['efiEnabled'] = efiEnabled;
this['efiPersistentStateEnabled'] = efiPersistentStateEnabled;
this['tpmEnabled'] = tpmEnabled; this['tpmEnabled'] = tpmEnabled;
this['tpmPersistentStateEnabled'] = tpmPersistentStateEnabled;
this['secureBoot'] = secureBoot; this['secureBoot'] = secureBoot;
this['cpuPinning'] = cpuPinning; this['cpuPinning'] = cpuPinning;
@@ -1383,13 +1389,21 @@ export default {
} }
}, },
setBootMethod(boot = { efi: false, secureBoot: false }) { setBootMethod(boot = {
if (boot.efi && boot.secureBoot) { efi: false, secureBoot: false, efiPersistentStateEnabled: false
set(this.spec.template.spec.domain, 'features.smm.enabled', true); }) {
set(this.spec.template.spec.domain, 'firmware.bootloader.efi.secureBoot', true); if (boot.efi) {
} else if (boot.efi && !boot.secureBoot) { set(this.spec.template.spec.domain, 'firmware.bootloader.efi.secureBoot', boot.secureBoot);
// set(this.spec.template.spec.domain, 'features.smm.enabled', false); } else {
delete this.spec.template.spec.domain['firmware'];
delete this.spec.template.spec.domain.features['smm'];
return;
}
if (boot.secureBoot) {
set(this.spec.template.spec.domain, 'features.smm.enabled', true);
} else {
try { try {
delete this.spec.template.spec.domain.features.smm['enabled']; delete this.spec.template.spec.domain.features.smm['enabled'];
const noKeys = Object.keys(this.spec.template.spec.domain.features.smm).length === 0; const noKeys = Object.keys(this.spec.template.spec.domain.features.smm).length === 0;
@@ -1398,10 +1412,12 @@ export default {
delete this.spec.template.spec.domain.features['smm']; delete this.spec.template.spec.domain.features['smm'];
} }
} catch (e) {} } catch (e) {}
set(this.spec.template.spec.domain, 'firmware.bootloader.efi.secureBoot', false); }
if (boot.efiPersistentStateEnabled) {
set(this.spec.template.spec.domain, 'firmware.bootloader.efi.persistent', true);
} else { } else {
delete this.spec.template.spec.domain['firmware']; delete this.spec.template.spec.domain.firmware.bootloader.efi['persistent'];
delete this.spec.template.spec.domain.features['smm'];
} }
}, },
@@ -1413,9 +1429,9 @@ export default {
} }
}, },
setTPM(tpmEnabled) { setTPM({ tpmEnabled = false, tpmPersistentStateEnabled = false } = {}) {
if (tpmEnabled) { if (tpmEnabled) {
set(this.spec.template.spec.domain.devices, 'tpm', {}); set(this.spec.template.spec.domain.devices, 'tpm', tpmPersistentStateEnabled ? { persistent: true } : {});
} else { } else {
delete this.spec.template.spec.domain.devices['tpm']; delete this.spec.template.spec.domain.devices['tpm'];
} }
@@ -1529,11 +1545,21 @@ export default {
}, },
efiEnabled(val) { efiEnabled(val) {
this.setBootMethod({ efi: val, secureBoot: this.secureBoot }); this.setBootMethod({
efi: val, secureBoot: this.secureBoot, efiPersistentStateEnabled: this.efiPersistentStateEnabled
});
}, },
secureBoot(val) { secureBoot(val) {
this.setBootMethod({ efi: this.efiEnabled, secureBoot: val }); this.setBootMethod({
efi: this.efiEnabled, secureBoot: val, efiPersistentStateEnabled: this.efiPersistentStateEnabled
});
},
efiPersistentStateEnabled(val) {
this.setBootMethod({
efi: this.efiEnabled, secureBoot: this.secureBoot, efiPersistentStateEnabled: val
});
}, },
cpuPinning(value) { cpuPinning(value) {
@@ -1541,7 +1567,11 @@ export default {
}, },
tpmEnabled(val) { tpmEnabled(val) {
this.setTPM(val); this.setTPM({ tpmEnabled: val, tpmPersistentStateEnabled: this.tpmPersistentStateEnabled });
},
tpmPersistentStateEnabled(val) {
this.setTPM({ tpmEnabled: this.tpmEnabled, tpmPersistentStateEnabled: val });
}, },
installAgent: { installAgent: {
@@ -238,7 +238,7 @@ export default class HciPv extends HarvesterResource {
} }
get isEncrypted() { get isEncrypted() {
return this.relatedPV?.spec.csi.volumeAttributes.encrypted === 'true'; return this.relatedPV?.spec?.csi?.volumeAttributes?.encrypted === 'true';
} }
get longhornVolume() { get longhornVolume() {
@@ -3,4 +3,4 @@ import SteveSchema from '@shell/models/steve-schema';
/** /**
* This is the steve schema that's used for the harvester store * This is the steve schema that's used for the harvester store
*/ */
export default class HarvesterStoreSchema extends SteveSchema { } export default class HarvesterStoreSchema extends SteveSchema {}
@@ -64,4 +64,10 @@ export default class HciBlockDevice extends HarvesterResource {
// spec.fileSystem.provisioned is deprecated // spec.fileSystem.provisioned is deprecated
return this.spec?.fileSystem?.provisioned || this.spec?.provision; return this.spec?.fileSystem?.provisioned || this.spec?.provision;
} }
// Overwrite cleanForSave() in shell/plugins/steve/steve-class.js as it deleted status object in harvesterhci.io.blockdevice CRD
// but /v1/harvester/harvesterhci.io.blockdevices/longhorn-system/{id} API requires status object
cleanForSave(data) {
return data;
}
} }
@@ -210,6 +210,10 @@ export default class HciVmTemplateVersion extends HarvesterResource {
await templateResource.save(); await templateResource.save();
} }
get cpuPinningFeatureEnabled() {
return this.$rootGetters['harvester-common/getFeatureEnabled']('cpuPinning');
}
get defaultVersion() { get defaultVersion() {
const templates = this.$rootGetters['harvester/all'](HCI.VM_TEMPLATE); const templates = this.$rootGetters['harvester/all'](HCI.VM_TEMPLATE);
const template = templates.find((T) => this.templateId === T.id); const template = templates.find((T) => this.templateId === T.id);
@@ -272,4 +276,12 @@ export default class HciVmTemplateVersion extends HarvesterResource {
this.spec.vm.spec.template.metadata['labels'] = { ...wasIgnored, ...val }; this.spec.vm.spec.template.metadata['labels'] = { ...wasIgnored, ...val };
} }
get tpmPersistentStateFeatureEnabled() {
return this.$rootGetters['harvester-common/getFeatureEnabled']('tpmPersistentState');
}
get efiPersistentStateFeatureEnabled() {
return this.$rootGetters['harvester-common/getFeatureEnabled']('efiPersistentState');
}
} }
@@ -1,5 +1,8 @@
import SteveModel from '@shell/plugins/steve/steve-class'; import SteveModel from '@shell/plugins/steve/steve-class';
import { HCI } from '@shell/config/labels-annotations'; import { HCI } from '@shell/config/labels-annotations';
import { NETWORK_TYPE } from '../config/types';
const { UNTAGGED } = NETWORK_TYPE;
export default class NetworkAttachmentDef extends SteveModel { export default class NetworkAttachmentDef extends SteveModel {
applyDefaults() { applyDefaults() {
@@ -42,7 +45,7 @@ export default class NetworkAttachmentDef extends SteveModel {
} }
get vlanId() { get vlanId() {
return this.vlanType === 'UntaggedNetwork' ? 'N/A' : this.parseConfig.vlan; return this.vlanType === UNTAGGED ? 'N/A' : this.parseConfig.vlan;
} }
get customValidationRules() { get customValidationRules() {
@@ -65,7 +68,7 @@ export default class NetworkAttachmentDef extends SteveModel {
const route = annotations[HCI.NETWORK_ROUTE]; const route = annotations[HCI.NETWORK_ROUTE];
let config = {}; let config = {};
if (this.vlanType === 'UntaggedNetwork') { if (this.vlanType === UNTAGGED) {
return 'N/A'; return 'N/A';
} }
@@ -640,6 +640,10 @@ export default class VirtVm extends HarvesterResource {
} }
get encryptedVolumeType() { get encryptedVolumeType() {
if (!this.volumes || this.volumes.length === 0) {
return 'none';
}
if (this.volumes.every((vol) => vol.isEncrypted)) { if (this.volumes.every((vol) => vol.isEncrypted)) {
return 'all'; return 'all';
} else if (this.volumes.some((vol) => vol.isEncrypted)) { } else if (this.volumes.some((vol) => vol.isEncrypted)) {
@@ -1171,6 +1175,14 @@ export default class VirtVm extends HarvesterResource {
return this.$rootGetters['harvester-common/getFeatureEnabled']('volumeEncryption'); return this.$rootGetters['harvester-common/getFeatureEnabled']('volumeEncryption');
} }
get tpmPersistentStateFeatureEnabled() {
return this.$rootGetters['harvester-common/getFeatureEnabled']('tpmPersistentState');
}
get efiPersistentStateFeatureEnabled() {
return this.$rootGetters['harvester-common/getFeatureEnabled']('efiPersistentState');
}
setInstanceLabels(val) { setInstanceLabels(val) {
if ( !this.spec?.template?.metadata?.labels ) { if ( !this.spec?.template?.metadata?.labels ) {
set(this, 'spec.template.metadata.labels', {}); set(this, 'spec.template.metadata.labels', {});
@@ -164,7 +164,7 @@ export default {
<h1 class="mb-20"> <h1 class="mb-20">
{{ t('branding.label') }} {{ t('branding.label') }}
</h1> </h1>
<TypeDescription resource="branding" /> <TypeDescription resource="harvester" />
<div> <div>
<div class="row mb-20"> <div class="row mb-20">
<div class="col span-6"> <div class="col span-6">
@@ -180,7 +180,7 @@ export default {
{{ t('branding.logos.label') }} {{ t('branding.logos.label') }}
</h3> </h3>
<label class="text-label"> <label class="text-label">
{{ t('branding.logos.tip', {}, true) }} {{ t('harvester.branding.logos.tip', {}, true) }}
</label> </label>
<div class="row mt-10 mb-20"> <div class="row mt-10 mb-20">
<Checkbox <Checkbox
@@ -244,7 +244,7 @@ export default {
{{ t('branding.favicon.label') }} {{ t('branding.favicon.label') }}
</h3> </h3>
<label class="text-label"> <label class="text-label">
{{ t('branding.favicon.tip', {}, true) }} {{ t('harvester.branding.favicon.tip', {}, true) }}
</label> </label>
<div class="row mt-10 mb-20"> <div class="row mt-10 mb-20">
<Checkbox <Checkbox
+1
View File
@@ -8,6 +8,7 @@
"importHelpers": true, "importHelpers": true,
"moduleResolution": "node", "moduleResolution": "node",
"skipLibCheck": true, "skipLibCheck": true,
"useDefineForClassFields": false,
"esModuleInterop": true, "esModuleInterop": true,
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"sourceMap": true, "sourceMap": true,
+1469 -1012
View File
File diff suppressed because it is too large. Load diff