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

Commit 35d540e

Browse files
gianlucaborelloowainlewis
authored andcommitted
Properly exclude the local instance from the seeds list. (#131)
Signed-off-by: Gianluca Borello <g.borello@gmail.com>
1 parent b48cb69 commit 35d540e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/controllers/cluster/manager/innodb_cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func getReplicationGroupSeeds(seeds string, pod *cluster.Instance) ([]string, er
7676
if err != nil {
7777
return nil, err
7878
}
79-
if seedInstance.PodName() == pod.Name() {
79+
if seedInstance.Name() == pod.Name() {
8080
continue
8181
}
8282
s = append(s, seed)

pkg/controllers/cluster/manager/innodb_cluster_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ func TestGetReplicationGroupSeeds(t *testing.T) {
3232
{
3333
seeds: "server-1-0:1234,server-1-1:1234",
3434
pod: cluster.NewInstance("", "", "server-1", 0, -1, false),
35-
expected: []string{"server-1-0:1234", "server-1-1:1234"},
35+
expected: []string{"server-1-1:1234"},
3636
}, {
3737
seeds: "server-1-1:1234,server-1-0:1234",
3838
pod: cluster.NewInstance("", "", "server-1", 0, -1, false),
39-
expected: []string{"server-1-1:1234", "server-1-0:1234"},
39+
expected: []string{"server-1-1:1234"},
4040
}, {
4141
seeds: "server-1-0:1234,server-1-1:1234",
4242
pod: cluster.NewInstance("", "", "server-2", 0, -1, false),

0 commit comments

Comments
 (0)