Skip to content

Commit 54b12cc

Browse files
pooknullhors
andauthored
K8SPG-757: restricted security context for patroni version check container (#1202)
https://perconadev.atlassian.net/browse/K8SPG-757 Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
1 parent c02af82 commit 54b12cc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

percona/controller/pgcluster/controller.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import (
3939
"sigs.k8s.io/controller-runtime/pkg/source"
4040

4141
"github.com/percona/percona-postgresql-operator/internal/controller/runtime"
42+
"github.com/percona/percona-postgresql-operator/internal/initialize"
4243
"github.com/percona/percona-postgresql-operator/internal/logging"
4344
"github.com/percona/percona-postgresql-operator/internal/naming"
4445
"github.com/percona/percona-postgresql-operator/internal/postgres"
@@ -436,7 +437,8 @@ func (r *PGClusterReconciler) reconcilePatroniVersionCheck(ctx context.Context,
436437
Args: []string{
437438
"-c", "sleep 60",
438439
},
439-
Resources: cr.Spec.InstanceSets[0].Resources,
440+
Resources: cr.Spec.InstanceSets[0].Resources,
441+
SecurityContext: initialize.RestrictedSecurityContext(cr.CompareVersion("2.5.0") >= 0),
440442
},
441443
},
442444
SecurityContext: cr.Spec.InstanceSets[0].SecurityContext,

0 commit comments

Comments
 (0)