Skip to content

Commit a698814

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

File tree

1 file changed

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

1 file changed

+9
-7
lines changed

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

+9-7
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ export default {
358358
tagDisks = this.newDisks.filter(d => d.blockDevice && !isEqual(d.blockDevice.spec.tags, d.tags));
359359
360360
if (tagDisks.length === 0) {
361-
return Promise.resolve();
361+
return Promise.resolve();
362362
}
363363
} else if (addDisks.length !== 0 && removeDisks.length === 0) {
364364
const updatedDisks = addDisks.filter((d) => {
@@ -520,17 +520,19 @@ export default {
520520
async saveLonghornNode() {
521521
const inStore = this.$store.getters['currentProduct'].inStore;
522522
523-
const disks = this.longhornNode?.spec?.disks || {};
523+
const storageTags = clone(this.longhornNode?.spec?.tags);
524524
525-
// update each disk tags and scheduling
526-
this.newDisks.map((disk) => {
527-
(disks[disk.name] || {}).tags = disk.tags;
528-
(disks[disk.name] || {}).allowScheduling = disk.allowScheduling;
529-
});
530525
let count = 0;
531526
532527
const retrySave = async() => {
533528
try {
529+
this.longhornNode.spec.tags = storageTags;
530+
531+
this.newDisks.forEach((disk) => {
532+
(this.longhornNode?.spec?.disks?.[disk.name] || {}).tags = disk.tags;
533+
(this.longhornNode?.spec?.disks?.[disk.name] || {}).allowScheduling = disk.allowScheduling;
534+
});
535+
534536
await this.longhornNode.save();
535537
} catch (err) {
536538
if ((err.status === 409 || err.status === 403) && count < 3) {

0 commit comments

Comments
 (0)