Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions controllers/operator/mongodbreplicaset_controller_multi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,6 @@ func checkReplicaSetReconcileSuccessful(
assert.NoError(t, err)
}

// getReplicaSetMultiClusterMap simulates multiple K8s clusters using fake clients
func getReplicaSetMultiClusterMap(omConnectionFactory *om.CachedOMConnectionFactory) map[string]client.Client {
clientMap := make(map[string]client.Client)

for _, clusterName := range multiClusters {
fakeClientBuilder := mock.NewEmptyFakeClientBuilder()
fakeClientBuilder.WithInterceptorFuncs(interceptor.Funcs{
Get: mock.GetFakeClientInterceptorGetFunc(omConnectionFactory, true, true),
})

clientMap[clusterName] = kubernetesClient.NewClient(fakeClientBuilder.Build())
}

return clientMap
}

// TestReplicaSetMultiClusterScaling tests that multi-cluster ReplicaSets scale one member at a time
// across all clusters, similar to single-cluster behavior.
//
Expand Down
5 changes: 1 addition & 4 deletions pkg/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ func GetMultiServiceFQDN(stsName string, namespace string, clusterNum int, podNu
domain = strings.TrimPrefix(clusterDomain, ".")
}

// For StatefulSet pods, DNS format is: <pod-name>.<headless-service>.<namespace>.svc.<domain>
podName := GetMultiPodName(stsName, clusterNum, podNum)
headlessService := GetMultiHeadlessServiceName(stsName, clusterNum)
return fmt.Sprintf("%s.%s.%s.svc.%s", podName, headlessService, namespace, domain)
return fmt.Sprintf("%s.%s.svc.%s", GetMultiServiceName(stsName, clusterNum, podNum), namespace, domain)
}

func GetMultiServiceExternalDomain(stsName, externalDomain string, clusterNum, podNum int) string {
Expand Down