Compare commits

..
Author SHA1 Message Date
mergify[bot]andfreeze 5b7d54d0a3 chore: bump to v1.7.0-rc5 (#636) (#637)
(cherry picked from commit 416098ffd8)

Signed-off-by: Vicente Cheng <vicente.cheng@suse.com>
Co-authored-by: freeze <1615081+Vicente-Cheng@users.noreply.github.com>
2025-12-04 22:45:15 +08:00
renovate[bot] 99a216dfa0 deps: update dependency yaml to v2.8.2 (#634)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-30 16:55:46 +00:00
mergify[bot]andAndy Lee e4c85f510e chore: bump to v1.7.0-rc4 (#621) (#629)
(cherry picked from commit 3d7b96d86d)

Signed-off-by: Andy Lee <andy.lee@suse.com>
Co-authored-by: Andy Lee <andy.lee@suse.com>
2025-11-28 13:23:55 +08:00
mergify[bot]andCaio Torres f391f018de fix: create new secret on vm creation (#614) (#628)
* fix: create new secret on vm creation



* fix: ensure parseVM result is immutable



---------


(cherry picked from commit 0b37467f76)

Signed-off-by: Caio Torres <caio.torres@suse.com>
Co-authored-by: Caio Torres <caio.torres@suse.com>
2025-11-27 17:42:46 +08:00
renovate[bot] 4b2e92ea15 deps: update dependency node-forge to v1.3.2 [security] (#627)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-27 14:31:50 +08:00
mergify[bot]andAndy Lee 2f956d5946 feat: allow user to attach volume to muliple VMs (#620) (#622)
(cherry picked from commit d94003f8c2)

Signed-off-by: Andy Lee <andy.lee@suse.com>
Co-authored-by: Andy Lee <andy.lee@suse.com>
2025-11-27 14:30:44 +08:00
7 changed files with 40 additions and 32 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "harvester-ui-extension", "name": "harvester-ui-extension",
"version": "1.7.0-rc3", "version": "1.7.0-rc5",
"private": false, "private": false,
"engines": { "engines": {
"node": ">=20.0.0" "node": ">=20.0.0"
@@ -26,7 +26,7 @@
"json5": "2.2.3", "json5": "2.2.3",
"@types/lodash": "4.17.21", "@types/lodash": "4.17.21",
"merge": "2.1.1", "merge": "2.1.1",
"node-forge": "1.3.1", "node-forge": "1.3.2",
"nth-check": "2.1.1", "nth-check": "2.1.1",
"qs": "6.14.0", "qs": "6.14.0",
"roarr": "7.21.2", "roarr": "7.21.2",
@@ -62,7 +62,7 @@ export default {
return false; return false;
} }
return !pvc.attachVM; return true;
}) })
.map((pvc) => { .map((pvc) => {
return { return {
@@ -99,7 +99,6 @@ export default {
this.allPVCs this.allPVCs
.filter( (pvc) => { .filter( (pvc) => {
let isAvailable = true; let isAvailable = true;
let isBeingUsed = false;
this.rows.forEach( (O) => { this.rows.forEach( (O) => {
if (O.volumeName === pvc.metadata.name) { if (O.volumeName === pvc.metadata.name) {
@@ -111,17 +110,16 @@ export default {
return false; return false;
} }
// already used as image volume
if (this.idx > 0 && pvc.metadata?.annotations?.[HCI_ANNOTATIONS.IMAGE_ID]) {
return false;
}
if (pvc.isGoldenImageVolume) { if (pvc.isGoldenImageVolume) {
return false; return false;
} }
if (pvc.attachVM && isAvailable && pvc.attachVM?.id === this.vm?.id && this.isEdit) { return isAvailable && pvc.isAvailable;
isBeingUsed = false;
} else if (pvc.attachVM) {
isBeingUsed = true;
}
return isAvailable && !isBeingUsed && pvc.isAvailable;
}) })
.map((pvc) => { .map((pvc) => {
return { return {
@@ -490,6 +490,7 @@ export default {
if (this.isSingle) { if (this.isSingle) {
if (!this.value.spec.template.spec.hostname) { if (!this.value.spec.template.spec.hostname) {
this.value.spec.template.spec['hostname'] = this.value.metadata.name; this.value.spec.template.spec['hostname'] = this.value.metadata.name;
this.spec.template.spec['hostname'] = this.value.metadata.name;
} }
} }
+22 -13
View File
@@ -273,7 +273,7 @@ export default {
needNewSecret() { needNewSecret() {
// When creating a template it is always necessary to create a new secret. // When creating a template it is always necessary to create a new secret.
return this.isCreate ? true : this.showYaml ? false : this.resourceType === HCI.VM_VERSION; return this.showYaml ? false : this.resourceType === HCI.VM_VERSION || this.isCreate;
}, },
defaultTerminationSetting() { defaultTerminationSetting() {
@@ -708,17 +708,7 @@ export default {
const volumeClaimTemplates = []; const volumeClaimTemplates = [];
disk.forEach( (R, index) => { disk.forEach( (R, index) => {
const prefixName = this.value.metadata?.name || ''; const dataVolumeName = this.parseDataVolumeName(R);
let dataVolumeName = '';
if (R.source === SOURCE_TYPE.ATTACH_VOLUME) {
dataVolumeName = R.volumeName;
} else if (this.isClone || !this.hasCreateVolumes.includes(R.realName)) {
dataVolumeName = `${ prefixName }-${ R.name }-${ randomStr(5).toLowerCase() }`;
} else {
dataVolumeName = R.realName;
}
const _disk = this.parseDisk(R, index); const _disk = this.parseDisk(R, index);
const _volume = this.parseVolume(R, dataVolumeName); const _volume = this.parseVolume(R, dataVolumeName);
@@ -1013,6 +1003,25 @@ export default {
this['cpuMemoryHotplugEnabled'] = cpuMemoryHotplugEnabled; this['cpuMemoryHotplugEnabled'] = cpuMemoryHotplugEnabled;
}, },
parseDataVolumeName(R) {
const prefixName = this.value.metadata?.name || '';
let dataVolumeName = '';
if (!R.dataVolumeName) {
if (R.source === SOURCE_TYPE.ATTACH_VOLUME) {
dataVolumeName = R.volumeName;
} else if (this.isClone || !this.hasCreateVolumes.includes(R.realName)) {
dataVolumeName = `${ prefixName }-${ R.name }-${ randomStr(5).toLowerCase() }`;
} else {
dataVolumeName = R.realName;
}
R.dataVolumeName = dataVolumeName;
}
return R.dataVolumeName;
},
parseDisk(R, index) { parseDisk(R, index) {
const out = { name: R.name }; const out = { name: R.name };
@@ -1638,7 +1647,7 @@ export default {
secretRef: { secretRef: {
handler(secret) { handler(secret) {
if (secret && this.resourceType !== HCI.BACKUP) { if (secret && this.resourceType !== HCI.BACKUP && this.resourceType !== HCI.VM) {
this.secretName = secret?.metadata.name; this.secretName = secret?.metadata.name;
} }
}, },
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "harvester", "name": "harvester",
"description": "Rancher UI Extension for Harvester", "description": "Rancher UI Extension for Harvester",
"version": "1.7.0-rc3", "version": "1.7.0-rc5",
"private": false, "private": false,
"rancher": { "rancher": {
"annotations": { "annotations": {
+7 -7
View File
@@ -10310,10 +10310,10 @@ node-fetch@^2.6.7:
dependencies: dependencies:
whatwg-url "^5.0.0" whatwg-url "^5.0.0"
node-forge@1.3.1, node-forge@^1: node-forge@1.3.2, node-forge@^1:
version "1.3.1" version "1.3.2"
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.2.tgz#d0d2659a26eef778bf84d73e7f55c08144ee7750"
integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA== integrity sha512-6xKiQ+cph9KImrRh0VsjH2d8/GXA4FIMlgU4B757iI1ApvcyA9VlouP0yZJha01V+huImO+kKMU7ih+2+E14fw==
node-int64@^0.4.0: node-int64@^0.4.0:
version "0.4.0" version "0.4.0"
@@ -13728,9 +13728,9 @@ yaml@^1.10.0, yaml@^1.10.2, yaml@^1.7.2:
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
yaml@^2.5.1: yaml@^2.5.1:
version "2.8.1" version "2.8.2"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.8.1.tgz#1870aa02b631f7e8328b93f8bc574fac5d6c4d79" resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.8.2.tgz#5694f25eca0ce9c3e7a9d9e00ce0ddabbd9e35c5"
integrity sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw== integrity sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==
yargs-parser@^18.1.2: yargs-parser@^18.1.2:
version "18.1.3" version "18.1.3"