Skip to content

Commit cefbdc6

Browse files
author
Jeff McCormick
authored
fix pgpool pod label to be unique (#806)
1 parent fb0e889 commit cefbdc6

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

ansible/roles/pgo-operator/files/pgo-configs/pgpool-template.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"labels": {
77
"name": "{{.Name}}",
88
"pg-cluster": "{{.ClusterName}}",
9-
"crunchy-pgpool": "true",
9+
"crunchy-pgpool-pod": "true",
1010
"service-name": "{{.Name}}",
1111
"vendor": "crunchydata"
1212
}
@@ -17,7 +17,7 @@
1717
"matchLabels": {
1818
"name": "{{.Name}}",
1919
"pg-cluster": "{{.ClusterName}}",
20-
"crunchy-pgpool": "true",
20+
"crunchy-pgpool-pod": "true",
2121
"service-name": "{{.Name}}",
2222
"vendor": "crunchydata"
2323
}
@@ -27,7 +27,7 @@
2727
"labels": {
2828
"name": "{{.Name}}",
2929
"pg-cluster": "{{.ClusterName}}",
30-
"crunchy-pgpool": "true",
30+
"crunchy-pgpool-pod": "true",
3131
"service-name": "{{.Name}}",
3232
"vendor": "crunchydata"
3333
}

conf/postgres-operator/pgpool-template.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"labels": {
77
"name": "{{.Name}}",
88
"pg-cluster": "{{.ClusterName}}",
9-
"crunchy-pgpool": "true",
9+
"crunchy-pgpool-pod": "true",
1010
"service-name": "{{.Name}}",
1111
"vendor": "crunchydata"
1212
}
@@ -17,7 +17,7 @@
1717
"matchLabels": {
1818
"name": "{{.Name}}",
1919
"pg-cluster": "{{.ClusterName}}",
20-
"crunchy-pgpool": "true",
20+
"crunchy-pgpool-pod": "true",
2121
"service-name": "{{.Name}}",
2222
"vendor": "crunchydata"
2323
}
@@ -27,7 +27,7 @@
2727
"labels": {
2828
"name": "{{.Name}}",
2929
"pg-cluster": "{{.ClusterName}}",
30-
"crunchy-pgpool": "true",
30+
"crunchy-pgpool-pod": "true",
3131
"service-name": "{{.Name}}",
3232
"vendor": "crunchydata"
3333
}

config/labels.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ const LABEL_USERNAME = "username"
110110
const LABEL_PASSWORD = "password"
111111

112112
const LABEL_PGPOOL = "crunchy-pgpool"
113+
const LABEL_PGPOOL_POD = "crunchy-pgpool-pod"
113114
const LABEL_PGPOOL_SECRET = "pgpool-secret"
114115
const LABEL_PGPOOL_TASK_ADD = "pgpool-add"
115116
const LABEL_PGPOOL_TASK_DELETE = "pgpool-delete"

controller/podcontroller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ func isPostgresPod(newpod *apiv1.Pod) bool {
315315
log.Debugf("pgo-backrest-repo pod found [%s]", newpod.Name)
316316
return false
317317
}
318-
if newpod.ObjectMeta.Labels[config.LABEL_PGPOOL] == "true" {
318+
if newpod.ObjectMeta.Labels[config.LABEL_PGPOOL_POD] == "true" {
319319
log.Debugf("pgpool pod found [%s]", newpod.Name)
320320
return false
321321
}

0 commit comments

Comments
 (0)