Skip to content

Commit f6b6dd7

Browse files
authored
CLOUDP-235689: CI fixes for Multi-Cluster Replica Set unification feature branch (#612)
# Summary * Removed the unused `getReplicaSetMultiClusterMap` function to make the linter happy * Reverted `GetMultiServiceFQDN` back to it's original version as it was breaking a lot of unit and e2e tests. ## Proof of Work This will break `e2e_multi_cluster_new_replica_set_scale_up` (expected as this is a - WIP test), but fix other multi-cluster related tests for existing APIs. ## Checklist - [x] Have you linked a jira ticket and/or is the ticket in the title? - [x] Have you checked whether your jira ticket required DOCSP changes? - [x] Have you added changelog file? - use `skip-changelog` label if not needed - refer to [Changelog files and Release Notes](https://github.com/mongodb/mongodb-kubernetes/blob/master/CONTRIBUTING.md#changelog-files-and-release-notes) section in CONTRIBUTING.md for more details
1 parent 201c4ef commit f6b6dd7

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

controllers/operator/mongodbreplicaset_controller_multi_test.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -97,22 +97,6 @@ func checkReplicaSetReconcileSuccessful(
9797
assert.NoError(t, err)
9898
}
9999

100-
// getReplicaSetMultiClusterMap simulates multiple K8s clusters using fake clients
101-
func getReplicaSetMultiClusterMap(omConnectionFactory *om.CachedOMConnectionFactory) map[string]client.Client {
102-
clientMap := make(map[string]client.Client)
103-
104-
for _, clusterName := range multiClusters {
105-
fakeClientBuilder := mock.NewEmptyFakeClientBuilder()
106-
fakeClientBuilder.WithInterceptorFuncs(interceptor.Funcs{
107-
Get: mock.GetFakeClientInterceptorGetFunc(omConnectionFactory, true, true),
108-
})
109-
110-
clientMap[clusterName] = kubernetesClient.NewClient(fakeClientBuilder.Build())
111-
}
112-
113-
return clientMap
114-
}
115-
116100
// TestReplicaSetMultiClusterScaling tests that multi-cluster ReplicaSets scale one member at a time
117101
// across all clusters, similar to single-cluster behavior.
118102
//

pkg/dns/dns.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ func GetMultiServiceFQDN(stsName string, namespace string, clusterNum int, podNu
3737
domain = strings.TrimPrefix(clusterDomain, ".")
3838
}
3939

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

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

0 commit comments

Comments
 (0)