Skip to content

Commit 2063196

Browse files
Jonathan S. Katzjkatz
authored andcommitted
Fix bonus pgBadger sidecar on upgrade
We (me) did not put an explicit boolean check around the former pgBadger label, which would cause a bonus pgBadger sidecar to join upgraded clusters. Issue: [ch10298]
1 parent 091ddd7 commit 2063196

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/operator/cluster/upgrade.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ func preparePgclusterForUpgrade(pgcluster *crv1.Pgcluster, parameters map[string
504504

505505
// 4.6.0 moved pgBadger to use an attribute instead of a label. If this label
506506
// exists on the current CRD, move the value to the attribute.
507-
if _, ok := pgcluster.ObjectMeta.GetLabels()["crunchy-pgbadger"]; ok {
507+
if ok, _ := strconv.ParseBool(pgcluster.ObjectMeta.GetLabels()["crunchy-pgbadger"]); ok {
508508
pgcluster.Spec.PGBadger = true
509509
delete(pgcluster.ObjectMeta.Labels, "crunchy-pgbadger")
510510
}

0 commit comments

Comments
 (0)