Merge pull request #17067 from sstosh/e2e-play-kube

e2e: fix play_kube_test
This commit is contained in:
OpenShift Merge Robot 2023-01-11 14:31:40 -05:00 committed by GitHub
commit 1e451031ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -3162,12 +3162,18 @@ spec:
hostPathDir := filepath.Join(tempdir, testdir)
err := os.Mkdir(hostPathDir, 0755)
Expect(err).ToNot(HaveOccurred())
defer os.RemoveAll(hostPathDir)
hostPathDirFile := filepath.Join(hostPathDir, testfile)
f, err := os.Create(hostPathDirFile)
Expect(err).ToNot(HaveOccurred())
f.Close()
if selinux.GetEnabled() {
label := SystemExec("chcon", []string{"-t", "container_file_t", hostPathDirFile})
Expect(label).Should(Exit(0))
}
// Create container image with named volume
containerfile := fmt.Sprintf(`
FROM %s