Skip to content

Commit cd56f91

Browse files
jkatzJonathan S. Katz
authored andcommitted
Gracefully handle names with "replica" in pgo test
This provides an even tighter check than the one introduced in b0a276a to determine what is a primary vs. replica Service. Issue: [ch9764] Issue: #2047
1 parent 7825917 commit cd56f91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/apiserver/clusterservice/clusterimpl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ func TestCluster(name, selector, ns, pgouser string, allFlag bool) msgs.ClusterT
489489
switch {
490490
default:
491491
endpoint.InstanceType = msgs.ClusterTestInstanceTypePrimary
492-
case strings.HasSuffix(service.Name, msgs.PodTypeReplica):
492+
case (strings.HasSuffix(service.Name, "-"+msgs.PodTypeReplica) && strings.Count(service.Name, "-"+msgs.PodTypeReplica) == 1):
493493
endpoint.InstanceType = msgs.ClusterTestInstanceTypeReplica
494494
case service.Pgbouncer:
495495
endpoint.InstanceType = msgs.ClusterTestInstanceTypePGBouncer

0 commit comments

Comments
 (0)