diff --git a/pages/c/_cluster/apps/charts/install.vue b/pages/c/_cluster/apps/charts/install.vue index 3e1a422481..d8c1a58ca6 100644 --- a/pages/c/_cluster/apps/charts/install.vue +++ b/pages/c/_cluster/apps/charts/install.vue @@ -696,13 +696,16 @@ export default { return; } + const res = await this.repo.doAction((isUpgrade ? 'upgrade' : 'install'), input); const operationId = `${ res.operationNamespace }/${ res.operationName }`; // Non-admins without a cluster won't be able to fetch operations immediately await this.repo.waitForOperation(operationId); + // Dynamically use store decided when loading catalog (covers standard user case when there's not cluster) + const inStore = this.$store.getters['catalog/inStore']; - this.operation = await this.$store.dispatch('cluster/find', { + this.operation = await this.$store.dispatch(`${ inStore }/find`, { type: CATALOG.OPERATION, id: operationId }); diff --git a/store/catalog.js b/store/catalog.js index e179eae84c..49a2504da0 100644 --- a/store/catalog.js +++ b/store/catalog.js @@ -37,7 +37,8 @@ export const state = function() { namespacedRepos: [], charts: {}, versionInfos: {}, - config: { namespace: 'catalog' } + config: { namespace: 'catalog' }, + inStore: undefined, }; }; @@ -283,6 +284,10 @@ export const getters = { return steps; }; + }, + + inStore(state) { + return state.inStore; } }; @@ -293,6 +298,10 @@ export const mutations = { Object.assign(currentState, newState); }, + setInStore(state, inStore) { + state.inStore = inStore; + }, + setRepos(state, { cluster, namespaced }) { state.clusterRepos = cluster; state.namespacedRepos = namespaced; @@ -321,7 +330,7 @@ export const actions = { let promises = {}; // Installing an app? This is fine (in cluster store) // Fetching list of cluster templates? This is fine (in management store) - // Installing a cluster template? This isn't fine (in cluster store as per insalling app, but if there is no cluster we need to default to management) + // Installing a cluster template? This isn't fine (in cluster store as per installing app, but if there is no cluster we need to default to management) const inStore = rootGetters['currentCluster'] ? rootGetters['currentProduct'].inStore : 'management'; if ( rootGetters[`${ inStore }/schemaFor`](CATALOG.CLUSTER_REPO) ) { @@ -334,6 +343,9 @@ export const actions = { const hash = await allHash(promises); + // As per comment above, when there are no clusters this will be management. Store it such that it can be used for those cases + commit('setInStore', inStore); + commit('setRepos', hash); const repos = getters['repos'];