Skip to content

Commit

Permalink
Apply disks changes when retrying save requests
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
  • Loading branch information
torchiaf committed Jun 25, 2024
1 parent 382c6c1 commit d4fa8c8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pkg/harvester/edit/harvesterhci.io.host/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export default {
tagDisks = this.newDisks.filter(d => d.blockDevice && !isEqual(d.blockDevice.spec.tags, d.tags));
if (tagDisks.length === 0) {
return Promise.resolve();
return Promise.resolve();
}
} else if (addDisks.length !== 0 && removeDisks.length === 0) {
const updatedDisks = addDisks.filter((d) => {
Expand Down Expand Up @@ -493,16 +493,17 @@ export default {
async saveLonghornNode() {
const inStore = this.$store.getters['currentProduct'].inStore;
const disks = this.longhornNode?.spec?.disks || {};
this.newDisks.map((disk) => {
(disks[disk.name] || {}).tags = disk.tags;
});
const storageTags = clone(this.longhornNode?.spec?.tags);
let count = 0;
const retrySave = async() => {
try {
this.longhornNode.spec.tags = storageTags;
this.newDisks.forEach((disk) => {
(this.longhornNode?.spec?.disks?.[disk.name] || {}).tags = disk.tags;
});
await this.longhornNode.save();
} catch (err) {
if ((err.status === 409 || err.status === 403) && count < 3) {
Expand Down

0 comments on commit d4fa8c8

Please sign in to comment.