Skip to content

Commit

Permalink
Set readOnlyRootFilesystem to false by default (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
halim-lee authored Apr 4, 2022
1 parent 044b87e commit 8e29709
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1102,8 +1102,9 @@ func getSecurityContext(ba common.BaseComponent) *corev1.SecurityContext {
Capabilities: &corev1.Capabilities{
Drop: cap,
},
Privileged: &valFalse,
RunAsNonRoot: &valTrue,
Privileged: &valFalse,
ReadOnlyRootFilesystem: &valFalse,
RunAsNonRoot: &valTrue,
}

// Customize security context
Expand All @@ -1117,6 +1118,9 @@ func getSecurityContext(ba common.BaseComponent) *corev1.SecurityContext {
if baSecurityContext.Privileged == nil {
baSecurityContext.Privileged = secContext.Privileged
}
if baSecurityContext.ReadOnlyRootFilesystem == nil {
baSecurityContext.ReadOnlyRootFilesystem = secContext.ReadOnlyRootFilesystem
}
if baSecurityContext.RunAsNonRoot == nil {
baSecurityContext.RunAsNonRoot = secContext.RunAsNonRoot
}
Expand Down

0 comments on commit 8e29709

Please sign in to comment.