diff --git a/operator/controllers/patroni_core_controller.go b/operator/controllers/patroni_core_controller.go index 4e678830..fd141d76 100644 --- a/operator/controllers/patroni_core_controller.go +++ b/operator/controllers/patroni_core_controller.go @@ -445,6 +445,9 @@ func (pr *PatroniCoreReconciler) AddExcludeLabelToCm(c client.Client, cmName str } if foundCm.Labels == nil { foundCm.Labels = make(map[string]string) + } + + if foundCm.Labels["velero.io/exclude-from-backup"] != "true" { foundCm.Labels["velero.io/exclude-from-backup"] = "true" err = c.Update(context.TODO(), foundCm) if err != nil { diff --git a/operator/controllers/postgresservice_controller.go b/operator/controllers/postgresservice_controller.go index a633a6cf..53014958 100644 --- a/operator/controllers/postgresservice_controller.go +++ b/operator/controllers/postgresservice_controller.go @@ -598,6 +598,9 @@ func (r *PostgresServiceReconciler) AddExcludeLabelToCm(c client.Client, cmName } if foundCm.Labels == nil { foundCm.Labels = make(map[string]string) + } + + if foundCm.Labels["velero.io/exclude-from-backup"] != "true" { foundCm.Labels["velero.io/exclude-from-backup"] = "true" err = c.Update(context.TODO(), foundCm) if err != nil {