Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

Commit 34a0f80

Browse files
authored
Added CLUSTER_DNS_NAME env variable to customize headless service according to cluster dns (#181)
1 parent 95ffb44 commit 34a0f80

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/controller/mongodb/replica_set_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import (
5757

5858
const (
5959
agentImageEnv = "AGENT_IMAGE"
60+
clusterDNSName = "CLUSTER_DNS_NAME"
6061
versionUpgradeHookImageEnv = "VERSION_UPGRADE_HOOK_IMAGE"
6162
agentHealthStatusFilePathEnv = "AGENT_STATUS_FILEPATH"
6263
mongodbImageEnv = "MONGODB_IMAGE"
@@ -423,7 +424,7 @@ func (r ReplicaSetReconciler) ensureAutomationConfig(mdb mdbv1.MongoDB) error {
423424
}
424425

425426
func buildAutomationConfig(mdb mdbv1.MongoDB, mdbVersionConfig automationconfig.MongoDbVersionConfig, currentAc automationconfig.AutomationConfig, modifications ...automationconfig.Modification) (automationconfig.AutomationConfig, error) {
426-
domain := getDomain(mdb.ServiceName(), mdb.Namespace, "")
427+
domain := getDomain(mdb.ServiceName(), mdb.Namespace, os.Getenv(clusterDNSName))
427428

428429
builder := automationconfig.NewBuilder().
429430
SetTopology(automationconfig.ReplicaSetTopology).

0 commit comments

Comments
 (0)