Commit cf1ff08
committed
Prevent Panic if PG Deployments Scaled Down
If the primary and all replica Deployments are scaled to zero outside
of the context of the PostgreSQL Operator (e.g. by using
'kubectl scale deployment --replicas=0' instead of
'pgo update cluster --shutdown') and the associated pgcluster for the
Deployment(s) being scaled is not manually set to the proper "shutdown"
status, then the PostgreSQL Operator could panic as it continues to
attempt to synchronize Patroni/PostgreSQL configuration for the PG
cluster (specifically because no pods are found for the cluster). This
commit protects against a panic in this scenario by simply logging an
error when no Pods are found during an attempt to sync configuration.
Issue: [ch9278]1 parent 8f4b8f0 commit cf1ff08
1 file changed
+9
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
241 | 246 | | |
242 | 247 | | |
243 | 248 | | |
| |||
0 commit comments