tests: fix ps command in k8s-security-context

1. Use a container image that supports "ps --user 1000 -f".
2. Execute that command using:

sh -c "ps --user 1000 -f"

instead of passing additional arguments to sh:

sh -c ps --user 1000 -f

Fixes: #10019

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
This commit is contained in:
Dan Mihai
2024-07-16 20:39:32 +00:00
parent bcaf7fc3b4
commit 0e86a96157
2 changed files with 2 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ setup() {
# Check user
process="tail -f /dev/null"
kubectl exec $pod_name -- sh -c $cmd | grep "$process"
kubectl exec $pod_name -- sh -c "$cmd" | grep "$process"
}
teardown() {

View File

@@ -14,5 +14,5 @@ spec:
runAsUser: 1000
containers:
- name: sec-text
image: quay.io/prometheus/busybox:latest
image: quay.io/kata-containers/sysbench-kata:latest
command: ["tail", "-f", "/dev/null"]