Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.

append namespace to dns name in REPLICATION_GROUP_SEEDS #246

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions pkg/resources/statefulsets/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ func mysqlRootPassword(cluster *v1alpha1.Cluster) v1.EnvVar {
}
}

func getReplicationGroupSeeds(name string, members int) string {
func getReplicationGroupSeeds(name string, namespace string, members int) string {
seeds := []string{}
for i := 0; i < members; i++ {
seeds = append(seeds, fmt.Sprintf("%[1]s-%[2]d.%[1]s:%[3]d", name, i, replicationGroupPort))
seeds = append(seeds, fmt.Sprintf("%[1]s-%[2]d.%[1]s.%[3]s:%[4]d", name, i, namespace, replicationGroupPort))
}
return strings.Join(seeds, ",")
}
Expand Down Expand Up @@ -232,7 +232,7 @@ func mysqlAgentContainer(cluster *v1alpha1.Cluster, mysqlAgentImage string, root
agentVersion = version
}

replicationGroupSeeds := getReplicationGroupSeeds(cluster.Name, members)
replicationGroupSeeds := getReplicationGroupSeeds(cluster.Name, cluster.Namespace, members)

var resourceLimits corev1.ResourceRequirements
if cluster.Spec.Resources != nil && cluster.Spec.Resources.Agent != nil {
Expand Down