Skip to content

Commit d4fa8c8

Browse files
committed
Apply disks changes when retrying save requests
Signed-off-by: Francesco Torchia <[email protected]>
1 parent 382c6c1 commit d4fa8c8

File tree

1 file changed

+7
-6
lines changed
  • pkg/harvester/edit/harvesterhci.io.host

1 file changed

+7
-6
lines changed

pkg/harvester/edit/harvesterhci.io.host/index.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ export default {
337337
tagDisks = this.newDisks.filter(d => d.blockDevice && !isEqual(d.blockDevice.spec.tags, d.tags));
338338
339339
if (tagDisks.length === 0) {
340-
return Promise.resolve();
340+
return Promise.resolve();
341341
}
342342
} else if (addDisks.length !== 0 && removeDisks.length === 0) {
343343
const updatedDisks = addDisks.filter((d) => {
@@ -493,16 +493,17 @@ export default {
493493
async saveLonghornNode() {
494494
const inStore = this.$store.getters['currentProduct'].inStore;
495495
496-
const disks = this.longhornNode?.spec?.disks || {};
497-
498-
this.newDisks.map((disk) => {
499-
(disks[disk.name] || {}).tags = disk.tags;
500-
});
496+
const storageTags = clone(this.longhornNode?.spec?.tags);
501497
502498
let count = 0;
503499
504500
const retrySave = async() => {
505501
try {
502+
this.longhornNode.spec.tags = storageTags;
503+
this.newDisks.forEach((disk) => {
504+
(this.longhornNode?.spec?.disks?.[disk.name] || {}).tags = disk.tags;
505+
});
506+
506507
await this.longhornNode.save();
507508
} catch (err) {
508509
if ((err.status === 409 || err.status === 403) && count < 3) {

0 commit comments

Comments
 (0)