Skip to content

Commit d119a99

Browse files
committed
Add support for multiple affinity group types in Kubernetes cluster creation
1 parent 54537e9 commit d119a99

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ui/src/views/compute/CreateKubernetesCluster.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,9 @@ export default {
618618
},
619619
fetchAffinityGroups () {
620620
this.affinityGroups = []
621+
this.controlAffinityGroups = []
622+
this.workerAffinityGroups = []
623+
this.etcdAffinityGroups = []
621624
const params = {}
622625
if (!this.isObjectEmpty(this.selectedZone)) {
623626
params.zoneid = this.selectedZone.id
@@ -916,6 +919,16 @@ export default {
916919
size: values.size,
917920
clustertype: 'CloudManaged'
918921
}
922+
if (this.isAdminOrDomainAdmin()) {
923+
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
929+
}
930+
}
931+
}
919932
if (values.hypervisor !== null) {
920933
params.hypervisor = this.selectedZoneHypervisors[values.hypervisor].name.toLowerCase()
921934
}

0 commit comments

Comments
 (0)