From b1c6cef8ce017780aee0fbdab715e09eafa95e64 Mon Sep 17 00:00:00 2001 From: Gianni Carafa Date: Fri, 1 Nov 2024 23:23:53 +0100 Subject: [PATCH] fix race condition in app form --- client/src/components/apps/form.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/client/src/components/apps/form.vue b/client/src/components/apps/form.vue index d8b188f7..3ffb0d9c 100644 --- a/client/src/components/apps/form.vue +++ b/client/src/components/apps/form.vue @@ -1646,15 +1646,12 @@ export default defineComponent({ }, }, mounted() { - this.loadPipeline(); + this.loadPipelineAndApp(); this.loadStorageClasses(); this.loadPodsizeList(); this.loadBuildpacks(); this.loadClusterIssuers(); this.getDomains(); - if (this.app != 'new') { - this.loadApp(); // this may lead into a race condition with the buildpacks loaded in loadPipeline - } if (this.$route.query.template && this.$route.query.catalogId) { const catalogId = this.$route.query.catalogId as string; @@ -1762,7 +1759,7 @@ export default defineComponent({ changeName(name: string) { this.ingress.hosts[0].host = name+"."+this.pipelineData.domain; }, - loadPipeline() { + loadPipelineAndApp() { axios.get('/api/pipelines/'+this.pipeline).then(response => { this.pipelineData = response.data; @@ -1803,6 +1800,11 @@ export default defineComponent({ this.buildpack.run.readOnlyAppStorage = true; } + if (this.app != 'new') { + this.loadApp(); + } + + }); }, loadStorageClasses() {