Skip to content

Commit

Permalink
Add only non-null default pool Security Context values (#1403)
Browse files Browse the repository at this point in the history
  • Loading branch information
allanrogerr authored Jan 17, 2023
1 parent 9bb1b96 commit 03ace75
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pkg/resources/statefulsets/minio-statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,15 @@ func poolContainerSecurityContext(pool *miniov2.Pool) *v1.SecurityContext {
var runAsGroup int64 = 1000
// Default to Pod values
if pool.SecurityContext != nil {
runAsNonRoot = *pool.SecurityContext.RunAsNonRoot
runAsUser = *pool.SecurityContext.RunAsUser
runAsGroup = *pool.SecurityContext.RunAsGroup
if pool.SecurityContext.RunAsNonRoot != nil {
runAsNonRoot = *pool.SecurityContext.RunAsNonRoot
}
if pool.SecurityContext.RunAsUser != nil {
runAsUser = *pool.SecurityContext.RunAsUser
}
if pool.SecurityContext.RunAsGroup != nil {
runAsGroup = *pool.SecurityContext.RunAsGroup
}
}

containerSecurityContext := corev1.SecurityContext{
Expand Down

0 comments on commit 03ace75

Please sign in to comment.