Skip to content

Commit

Permalink
fix: Only add SC capabilities if vault templating is used (#218)
Browse files Browse the repository at this point in the history
Signed-off-by: Ivaylo Ivanov <[email protected]>
  • Loading branch information
sedadas authored Jan 23, 2024
1 parent dd5e627 commit 5c5715a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions pkg/webhook/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -859,13 +859,7 @@ func getBaseSecurityContext(podSecurityContext *corev1.PodSecurityContext, vault
AllowPrivilegeEscalation: &vaultConfig.PspAllowPrivilegeEscalation,
ReadOnlyRootFilesystem: &vaultConfig.ReadOnlyRootFilesystem,
Capabilities: &corev1.Capabilities{
Add: []corev1.Capability{
"CHOWN",
"SETFCAP",
"SETGID",
"SETPCAP",
"SETUID",
},
Add: []corev1.Capability{},
Drop: []corev1.Capability{
"ALL",
},
Expand Down
8 changes: 1 addition & 7 deletions pkg/webhook/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,13 +514,7 @@ func Test_mutatingWebhook_mutatePod(t *testing.T) {
ReadOnlyRootFilesystem: &vaultConfig.ReadOnlyRootFilesystem,
AllowPrivilegeEscalation: &vaultConfig.PspAllowPrivilegeEscalation,
Capabilities: &corev1.Capabilities{
Add: []corev1.Capability{
"CHOWN",
"SETFCAP",
"SETGID",
"SETPCAP",
"SETUID",
},
Add: []corev1.Capability{},
Drop: []corev1.Capability{
"ALL",
},
Expand Down

0 comments on commit 5c5715a

Please sign in to comment.