Skip to content

Commit

Permalink
add PSA label when running functional tests in OpenShift
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Henriksen <[email protected]>
  • Loading branch information
mhenriks committed Sep 11, 2022
1 parent c32c64c commit f53115b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/cdi-cloner/clone-source.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func newTarReader(preallocation bool) (io.ReadCloser, error) {
"lost+found": struct{}{},
}

args := []string{"cv"}
args := []string{"/usr/bin/tar", "cv"}
if !preallocation {
// -S is used to handle sparse files. It can only be used when preallocation is not requested
args = append(args, "-S")
Expand All @@ -175,7 +175,9 @@ func newTarReader(preallocation bool) (io.ReadCloser, error) {
args = append(args, "--files-from", "/dev/null")
}

cmd := exec.Command("/usr/bin/tar", args...)
klog.Infof("Executing %+v", args)

cmd := exec.Command(args[0], args[1:]...)
cmd.Dir = mountPoint

stdout, err := cmd.StdoutPipe()
Expand Down
3 changes: 3 additions & 0 deletions tests/framework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ func (f *Framework) CreateNamespace(prefix string, labels map[string]string) (*v
}
// pod-security.kubernetes.io/<MODE>: <LEVEL>
labels["pod-security.kubernetes.io/enforce"] = "restricted"
if utils.IsOpenshift(f.K8sClient) {
labels["security.openshift.io/scc.podSecurityLabelSync"] = "false"
}

ns := &v1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Expand Down

0 comments on commit f53115b

Please sign in to comment.