Skip to content

Commit

Permalink
Merge pull request #104551 from Elbehery/unprivileged_storage_client
Browse files Browse the repository at this point in the history
[sig-storage] Run storage e2e test_client_pod as privileged
  • Loading branch information
k8s-ci-robot authored Oct 20, 2021
2 parents 81636f2 + 04ad18c commit d5de03f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/e2e/framework/volume/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,16 @@ func runVolumeTesterPod(client clientset.Interface, timeouts *framework.TimeoutC
var gracePeriod int64 = 1
var command string

/**
This condition fixes running storage e2e tests in SELinux environment.
HostPath Volume Plugin creates a directory within /tmp on host machine, to be mounted as volume.
Inject-pod writes content to the volume, and a client-pod tries the read the contents and verify.
When SELinux is enabled on the host, client-pod can not read the content, with permission denied.
Invoking client-pod as privileged, so that it can access the volume content, even when SELinux is enabled on the host.
*/
if config.Prefix == "hostpathsymlink" || config.Prefix == "hostpath" {
privileged = true
}
command = "while true ; do sleep 2; done "
seLinuxOptions := &v1.SELinuxOptions{Level: "s0:c0,c1"}
clientPod := &v1.Pod{
Expand Down

0 comments on commit d5de03f

Please sign in to comment.