Skip to content

Commit

Permalink
fix error logic
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusvonkohout authored Oct 5, 2023
1 parent 7c9c383 commit ede01ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/e2e/runasnonroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ has_securityContext_and_runAsNonRoot() {
local securityContextContainer=$(kubectl get pod -n "$namespace" "$pod_name" -o json | jq -r '.spec.containers[] | select(.name == "'"$container_name"'").securityContext')

if [ "$securityContextContainer" = "null" ]; then
if [ "$runAsNonRootPod" = "Missing" ]; then
if [ "$securityContextPod" = "null" ]; then
echo "Error: 'securityContext' is missing at the pod and container level in container $container_name of pod $pod_name"
return 1
else
Expand Down

0 comments on commit ede01ea

Please sign in to comment.