Skip to content

Commit 57a4653

Browse files
authored
Merge pull request kubernetes#95321 from harche/fix_cap
add CAP_NET_RAW capability to CRI stats summery test
2 parents a9bfd88 + 17e5f4e commit 57a4653

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/e2e_node/summary_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"strings"
2424
"time"
2525

26-
"k8s.io/api/core/v1"
26+
v1 "k8s.io/api/core/v1"
2727
"k8s.io/apimachinery/pkg/api/resource"
2828
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2929
kubeletstatsv1alpha1 "k8s.io/kubelet/pkg/apis/stats/v1alpha1"
@@ -352,8 +352,13 @@ func getSummaryTestPods(f *framework.Framework, numRestarts int32, names ...stri
352352
RestartPolicy: v1.RestartPolicyAlways,
353353
Containers: []v1.Container{
354354
{
355-
Name: "busybox-container",
356-
Image: busyboxImage,
355+
Name: "busybox-container",
356+
Image: busyboxImage,
357+
SecurityContext: &v1.SecurityContext{
358+
Capabilities: &v1.Capabilities{
359+
Add: []v1.Capability{"CAP_NET_RAW"},
360+
},
361+
},
357362
Command: getRestartingContainerCommand("/test-empty-dir-mnt", 0, numRestarts, "echo 'some bytes' >/outside_the_volume.txt; ping -c 1 google.com; echo 'hello world' >> /test-empty-dir-mnt/file;"),
358363
Resources: v1.ResourceRequirements{
359364
Limits: v1.ResourceList{

0 commit comments

Comments
 (0)