Use privileged containers for statefulset e2e tests

Test containers need to run as spc_t in order to interact with the host filesystem under /tmp, as the tests for StatefulSet are doing. Docker will transition the container into this domain when running the container as privileged. Signed-off-by: 's avatarSteve Kuznetsov <skuznets@redhat.com>
parent b2ea7807
......@@ -722,7 +722,7 @@ func (s *statefulSetTester) createStatefulSet(manifestPath, ns string) *apps.Sta
func (s *statefulSetTester) checkMount(ss *apps.StatefulSet, mountPath string) error {
for _, cmd := range []string{
// Print inode, size etc
fmt.Sprintf("ls -idlh %v", mountPath),
fmt.Sprintf("ls -idlhZ %v", mountPath),
// Print subdirs
fmt.Sprintf("find %v", mountPath),
// Try writing
......@@ -1118,6 +1118,8 @@ func newStatefulSet(name, ns, governingSvcName string, replicas int32, statefulP
})
}
privileged := true
return &apps.StatefulSet{
TypeMeta: metav1.TypeMeta{
Kind: "StatefulSet",
......@@ -1143,6 +1145,9 @@ func newStatefulSet(name, ns, governingSvcName string, replicas int32, statefulP
Name: "nginx",
Image: nginxImage,
VolumeMounts: mounts,
SecurityContext: &v1.SecurityContext{
Privileged: &privileged,
},
},
},
Volumes: vols,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment