Skip to content

Commit 18f0796

Browse files
jkatzJonathan S. Katz
authored andcommitted
Properly identify pgAdmin Service from pgo test
This was previously showing up as a "primary", which it certainly isn't. Now it is properly identified as its own thing, i.e. pgAdmin. Issue: [ch11100]
1 parent 58ae4db commit 18f0796

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

internal/apiserver/clusterservice/clusterimpl.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,15 @@ func getServices(cluster *crv1.Pgcluster, ns string) ([]msgs.ShowClusterService,
301301
for _, p := range services.Items {
302302
d := msgs.ShowClusterService{}
303303
d.Name = p.Name
304-
if strings.Contains(p.Name, "-backrest-repo") {
304+
if strings.HasSuffix(p.Name, "-backrest-repo") {
305305
d.BackrestRepo = true
306306
d.ClusterName = cluster.Name
307-
} else if strings.Contains(p.Name, "-pgbouncer") {
307+
} else if strings.HasSuffix(p.Name, "-pgbouncer") {
308308
d.Pgbouncer = true
309309
d.ClusterName = cluster.Name
310+
} else if strings.HasSuffix(p.Name, "-pgadmin") {
311+
d.PGAdmin = true
312+
d.ClusterName = cluster.Name
310313
}
311314
d.ClusterIP = p.Spec.ClusterIP
312315
for _, port := range p.Spec.Ports {
@@ -487,6 +490,8 @@ func TestCluster(name, selector, ns, pgouser string, allFlag bool) msgs.ClusterT
487490
endpoint.InstanceType = msgs.ClusterTestInstanceTypePrimary
488491
case (strings.HasSuffix(service.Name, "-"+msgs.PodTypeReplica) && strings.Count(service.Name, "-"+msgs.PodTypeReplica) == 1):
489492
endpoint.InstanceType = msgs.ClusterTestInstanceTypeReplica
493+
case service.PGAdmin:
494+
endpoint.InstanceType = msgs.ClusterTestInstanceTypePGAdmin
490495
case service.Pgbouncer:
491496
endpoint.InstanceType = msgs.ClusterTestInstanceTypePGBouncer
492497
case service.BackrestRepo:

pkg/apiservermsgs/clustermsgs.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ type ShowClusterService struct {
248248
ClusterName string
249249
Pgbouncer bool
250250
BackrestRepo bool
251+
PGAdmin bool
251252
}
252253

253254
const PodTypePrimary = "primary"
@@ -452,6 +453,7 @@ type ClusterTestRequest struct {
452453
const (
453454
ClusterTestInstanceTypePrimary = "primary"
454455
ClusterTestInstanceTypeReplica = "replica"
456+
ClusterTestInstanceTypePGAdmin = "pgadmin"
455457
ClusterTestInstanceTypePGBouncer = "pgbouncer"
456458
ClusterTestInstanceTypeBackups = "backups"
457459
ClusterTestInstanceTypeUnknown = "unknown"

0 commit comments

Comments
 (0)