Merge pull request #41089 from stevekuznetsov/skuznets/statefulset-e2e-test

Automatic merge from submit-queue (batch tested with PRs 41145, 38771, 41003, 41089, 40365)

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: Steve Kuznetsov <skuznets@redhat.com>

**Release note**:
```release-note
NONE
```

/cc @ncdc @soltysh @pmorie
This commit is contained in:
Kubernetes Submit Queue 2017-02-09 13:34:52 -08:00 committed by GitHub
commit 3de8b4ae69

View File

@ -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,