Skip to content

Commit bca83b6

Browse files
committed
feat: set default user and group
Signed-off-by: Bence Csati <[email protected]>
1 parent c83e05e commit bca83b6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

pkg/sdk/logging/api/v1beta1/fluentd_types.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,19 @@ func (f *FluentdSpec) SetDefaults() error {
170170
f.Security.RoleBasedAccessControlCreate = util.BoolPointer(true)
171171
}
172172
if f.Security.SecurityContext == nil {
173-
f.Security.SecurityContext = &corev1.SecurityContext{}
173+
f.Security.SecurityContext = &corev1.SecurityContext{
174+
RunAsUser: util.IntPointer64(100),
175+
RunAsGroup: util.IntPointer64(101),
176+
RunAsNonRoot: util.BoolPointer(true),
177+
}
174178
}
175179
if f.Security.PodSecurityContext == nil {
176-
f.Security.PodSecurityContext = &corev1.PodSecurityContext{}
180+
f.Security.PodSecurityContext = &corev1.PodSecurityContext{
181+
RunAsUser: util.IntPointer64(100),
182+
RunAsGroup: util.IntPointer64(101),
183+
RunAsNonRoot: util.BoolPointer(true),
184+
FSGroup: util.IntPointer64(101),
185+
}
177186
}
178187
if f.Security.PodSecurityContext.FSGroup == nil {
179188
f.Security.PodSecurityContext.FSGroup = util.IntPointer64(101)

0 commit comments

Comments
 (0)