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 Feb 28, 2024
1 parent cbeee2d commit d196e22
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/harvester/edit/harvesterhci.io.host/index.vue
Original file line number Diff line number Diff line change
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 d196e22

Please sign in to comment.