Merge pull request #9714 from torchiaf/9665-provissioning-actions-error

Fix 'Scale Down' crash in cluster provisioning details page
This commit is contained in:
Richard Cox 2023-09-28 16:06:56 +01:00 committed by GitHub
commit df9c4be595
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -806,7 +806,7 @@ export default {
return false;
}
const matchingResourceAction = resource.availableActions.find((a) => a.action === this.actionOfInterest.action);
const matchingResourceAction = resource.availableActions?.find((a) => a.action === this.actionOfInterest.action);
return matchingResourceAction?.enabled;
},

View File

@ -339,9 +339,10 @@ export default {
pool._clusterSpec = mp;
return {
poolId: pool.id,
mainRowKey: 'isFake',
poolId: pool.id,
mainRowKey: 'isFake',
pool,
availableActions: []
};
});
},
@ -361,9 +362,10 @@ export default {
const emptyNodePools = this.allNodePools.filter((x) => x.spec.clusterName === this.value.mgmtClusterId && x.spec.quantity === 0);
return emptyNodePools.map((np) => ({
spec: { nodePoolName: np.id.replace('/', ':') },
mainRowKey: 'isFake',
pool: np,
spec: { nodePoolName: np.id.replace('/', ':') },
mainRowKey: 'isFake',
pool: np,
availableActions: []
}));
},