From 23c0b0080891651d6c23d094ee369f3defc70226 Mon Sep 17 00:00:00 2001 From: Hiranmoy Das Chowdhury Date: Fri, 20 Dec 2024 18:14:49 +0600 Subject: [PATCH] finished security context Signed-off-by: Hiranmoy Das Chowdhury --- apis/kubedb/v1/pgbouncer_helpers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apis/kubedb/v1/pgbouncer_helpers.go b/apis/kubedb/v1/pgbouncer_helpers.go index 34b6bb366c..57bdd8151f 100644 --- a/apis/kubedb/v1/pgbouncer_helpers.go +++ b/apis/kubedb/v1/pgbouncer_helpers.go @@ -239,10 +239,10 @@ func (p *PgBouncer) SetDefaults(pgBouncerVersion *catalog.PgBouncerVersion, uses // that's why we need to set RunAsUser and RunAsGroup 70 if p.Spec.Monitor != nil && p.Spec.Monitor.Prometheus != nil { if p.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsUser == nil { - p.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsUser = pointer.Int64P(70) + p.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsUser = pointer.Int64P(*pgBouncerVersion.Spec.SecurityContext.RunAsUser) } if p.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsGroup == nil { - p.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsGroup = pointer.Int64P(70) + p.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsGroup = pointer.Int64P(*pgBouncerVersion.Spec.SecurityContext.RunAsUser) } } dbContainer := core_util.GetContainerByName(p.Spec.PodTemplate.Spec.Containers, ResourceSingularPgBouncer)