Skip to content

Commit

Permalink
Adds tests for NET_BIND_SERVICE from here: #4066
Browse files Browse the repository at this point in the history
  • Loading branch information
missylbytes committed Jun 26, 2024
1 parent 0ae97a0 commit cd4a687
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,9 @@ func TestHandlerConsulDataplaneSidecar_withSecurityContext(t *testing.T) {
RunAsNonRoot: pointer.Bool(true),
ReadOnlyRootFilesystem: pointer.Bool(true),
AllowPrivilegeEscalation: pointer.Bool(false),
Capabilities: &corev1.Capabilities{
Add: []corev1.Capability{"NET_BIND_SERVICE"},
},
},
},
"tproxy enabled; openshift disabled": {
Expand All @@ -817,12 +820,19 @@ func TestHandlerConsulDataplaneSidecar_withSecurityContext(t *testing.T) {
RunAsNonRoot: pointer.Bool(true),
ReadOnlyRootFilesystem: pointer.Bool(true),
AllowPrivilegeEscalation: pointer.Bool(false),
Capabilities: &corev1.Capabilities{
Add: []corev1.Capability{"NET_BIND_SERVICE"},
},
},
},
"tproxy disabled; openshift enabled": {
tproxyEnabled: false,
openShiftEnabled: true,
expSecurityContext: nil,
tproxyEnabled: false,
openShiftEnabled: true,
expSecurityContext: &corev1.SecurityContext{
Capabilities: &corev1.Capabilities{
Add: []corev1.Capability{"NET_BIND_SERVICE"},
},
},
},
"tproxy enabled; openshift enabled": {
tproxyEnabled: true,
Expand All @@ -833,6 +843,9 @@ func TestHandlerConsulDataplaneSidecar_withSecurityContext(t *testing.T) {
RunAsNonRoot: pointer.Bool(true),
ReadOnlyRootFilesystem: pointer.Bool(true),
AllowPrivilegeEscalation: pointer.Bool(false),
Capabilities: &corev1.Capabilities{
Add: []corev1.Capability{"NET_BIND_SERVICE"},
},
},
},
}
Expand Down

0 comments on commit cd4a687

Please sign in to comment.