diff --git a/apis/kubedb/v1alpha2/constants.go b/apis/kubedb/v1alpha2/constants.go index dfdfbe28e3..ee05418bfb 100644 --- a/apis/kubedb/v1alpha2/constants.go +++ b/apis/kubedb/v1alpha2/constants.go @@ -565,6 +565,7 @@ const ( PgBouncerAdminUsername = "pgbouncer" PgBouncerDefaultPoolMode = "session" PgBouncerDefaultIgnoreStartupParameters = "empty" + BackendSecretResourceVersion = "backend-secret-resource-version" // =========================== Pgpool Constants ============================ EnvPostgresUsername = "POSTGRES_USERNAME" diff --git a/apis/kubedb/v1alpha2/pgbouncer_helpers.go b/apis/kubedb/v1alpha2/pgbouncer_helpers.go index e3445716ed..28646038c9 100644 --- a/apis/kubedb/v1alpha2/pgbouncer_helpers.go +++ b/apis/kubedb/v1alpha2/pgbouncer_helpers.go @@ -63,8 +63,10 @@ func (p PgBouncer) OffshootLabels() map[string]string { return p.offshootLabels(p.OffshootSelectors(), nil) } -func (p PgBouncer) PodLabels() map[string]string { - return p.offshootLabels(p.OffshootSelectors(), p.Spec.PodTemplate.Labels) +func (p PgBouncer) PodLabels(backendSecretRV string) map[string]string { + podLabels := p.offshootLabels(p.OffshootSelectors(), p.Spec.PodTemplate.Labels) + podLabels[BackendSecretResourceVersion] = backendSecretRV + return podLabels } func (p PgBouncer) PodControllerLabels() map[string]string {