Skip to content

Commit 163855f

Browse files
author
jmccormick2001
committed
fix bug in pgo test, added to selector for finding primary and replicas
1 parent 309ae53 commit 163855f

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

apiserver/clusterservice/clusterimpl.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ func TestCluster(name, selector, ns string) msgs.ClusterTestResponse {
333333
response.Status.Msg = err.Error()
334334
return response
335335
}
336+
log.Debugf("pods found %d", len(pods))
336337
//loop thru the pods, make sure they are all ready
337338
primaryReady := true
338339
replicaReady := true
@@ -1341,7 +1342,7 @@ func GetPrimaryAndReplicaPods(cluster *crv1.Pgcluster, ns string) ([]msgs.ShowCl
13411342

13421343
output := make([]msgs.ShowClusterPod, 0)
13431344

1344-
selector := util.LABEL_SERVICE_NAME + "=" + cluster.Spec.Name
1345+
selector := util.LABEL_SERVICE_NAME + "=" + cluster.Spec.Name + "," + util.LABEL_DEPLOYMENT_NAME
13451346
log.Debugf("selector for GetPrimaryAndReplicaPods is %s", selector)
13461347

13471348
pods, err := kubeapi.GetPods(apiserver.Clientset, selector, ns)
@@ -1364,7 +1365,7 @@ func GetPrimaryAndReplicaPods(cluster *crv1.Pgcluster, ns string) ([]msgs.ShowCl
13641365
output = append(output, d)
13651366

13661367
}
1367-
selector = util.LABEL_SERVICE_NAME + "=" + cluster.Spec.Name + "-replica"
1368+
selector = util.LABEL_SERVICE_NAME + "=" + cluster.Spec.Name + "-replica" + "," + util.LABEL_DEPLOYMENT_NAME
13681369
log.Debugf("selector for GetPrimaryAndReplicaPods is %s", selector)
13691370

13701371
pods, err = kubeapi.GetPods(apiserver.Clientset, selector, ns)

conf/postgres-operator/pgo.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ Cluster:
2121
AutofailReplaceReplica: false
2222
LogStatement: none
2323
LogMinDurationStatement: 60000
24-
PrimaryStorage: nfsstorage
25-
XlogStorage: nfsstorage
26-
BackupStorage: nfsstorage
27-
ReplicaStorage: nfsstorage
28-
BackrestStorage: nfsstorage
24+
PrimaryStorage: rook
25+
XlogStorage: rook
26+
BackupStorage: rook
27+
ReplicaStorage: rook
28+
BackrestStorage: rook
2929
Storage:
3030
hostpathstorage:
3131
AccessMode: ReadWriteMany
@@ -61,6 +61,12 @@ Storage:
6161
StorageType: dynamic
6262
StorageClass: fast
6363
Fsgroup: 26
64+
rook:
65+
AccessMode: ReadWriteOnce
66+
Size: 1G
67+
StorageType: dynamic
68+
StorageClass: rook-ceph-block
69+
Fsgroup: 26
6470
DefaultContainerResources:
6571
DefaultLoadResources:
6672
DefaultLspvcResources:

0 commit comments

Comments
 (0)