Skip to content

Commit

Permalink
fix indents
Browse files Browse the repository at this point in the history
  • Loading branch information
nmarukovich committed Aug 15, 2023
1 parent 78345f1 commit 7de0ed4
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions pkg/apis/psmdb/v1/psmdb_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,25 +175,26 @@ func (cr *PerconaServerMongoDB) CheckNSetDefaults(platform version.Platform, log
cr.Spec.Sharding.Mongos.Size = minSafeMongosSize
}
}

var fsgroup *int64
if platform == version.PlatformKubernetes {
var tp int64 = 1001
fsgroup = &tp
}
if platform == version.PlatformKubernetes {
var tp int64 = 1001
fsgroup = &tp
}

if cr.Spec.Sharding.Mongos.ContainerSecurityContext == nil {
tvar := true
cr.Spec.Sharding.Mongos.ContainerSecurityContext = &corev1.SecurityContext{
RunAsNonRoot: &tvar,
RunAsUser: fsgroup,
}
}

if cr.Spec.Sharding.Mongos.PodSecurityContext == nil {
cr.Spec.Sharding.Mongos.PodSecurityContext = &corev1.PodSecurityContext{
FSGroup: fsgroup,
}
}
tvar := true
cr.Spec.Sharding.Mongos.ContainerSecurityContext = &corev1.SecurityContext{
RunAsNonRoot: &tvar,
RunAsUser: fsgroup,
}
}

if cr.Spec.Sharding.Mongos.PodSecurityContext == nil {
cr.Spec.Sharding.Mongos.PodSecurityContext = &corev1.PodSecurityContext{
FSGroup: fsgroup,
}
}

cr.Spec.Sharding.ConfigsvrReplSet.Name = ConfigReplSetName

Expand Down

0 comments on commit 7de0ed4

Please sign in to comment.