mirror of https://github.com/rancher/dashboard.git
Merge pull request #15322 from torchiaf/backport-15313-2.12
[2.12.2] Fix missing Fleet clusters updates after saving
This commit is contained in:
commit
fa2a1a1654
|
|
@ -56,10 +56,14 @@ export default {
|
|||
async save(buttonDone) {
|
||||
try {
|
||||
this.errors = [];
|
||||
|
||||
await this.value.save();
|
||||
|
||||
await this.normanCluster.save();
|
||||
|
||||
// Changes (such as labels or annotations fields) to normanCluster are reflected in the fleet cluster via Rancher services, so wait for that to occur
|
||||
await this.waitForFleetClusterLastRevision();
|
||||
|
||||
this.done();
|
||||
buttonDone(true);
|
||||
} catch (e) {
|
||||
|
|
@ -67,6 +71,21 @@ export default {
|
|||
buttonDone(false);
|
||||
}
|
||||
},
|
||||
|
||||
async waitForFleetClusterLastRevision() {
|
||||
const inStore = this.$store.getters['currentProduct'].inStore;
|
||||
|
||||
const currRev = this.value?.metadata?.resourceVersion;
|
||||
|
||||
try {
|
||||
return await this.value.waitForTestFn(() => {
|
||||
const rev = this.$store.getters[`${ inStore }/byId`](this.value.type, this.value.id)?.metadata?.resourceVersion;
|
||||
|
||||
return currRev && currRev !== rev;
|
||||
}, `${ this.value.id } - wait for resourceVersion to change`, 1000, 200);
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue