File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -921,12 +921,18 @@ export default {
921921 }
922922 if (this .isAdminOrDomainAdmin ()) {
923923 const selectedGroupIds = [... this .controlAffinityGroups , ... this .workerAffinityGroups , ... this .etcdAffinityGroups ]
924- if (selectedGroupIds .length > 0 ) {
925- const group = this .affinityGroups .find (affinityGroup => affinityGroup .id === selectedGroupIds[0 ])
926- if (group) {
927- params .domainid = group .domainid
928- params .account = group .account
924+ const selectedGroups = selectedGroupIds .map (id => this .affinityGroups .find (affinityGroup => affinityGroup .id === id)).filter (Boolean )
925+ if (selectedGroups .length > 0 ) {
926+ const hasMixedAccounts = selectedGroups .some (ag => ag .account !== selectedGroups[0 ].account )
927+ if (hasMixedAccounts) {
928+ this .$notification .error ({
929+ message: this .$t (' message.error.affinity.groups.different.accounts' )
930+ })
931+ this .loading = false
932+ return
929933 }
934+ params .domainid = selectedGroups[0 ].domainid
935+ params .account = selectedGroups[0 ].account
930936 }
931937 }
932938 if (values .hypervisor !== null ) {
You can’t perform that action at this time.
0 commit comments