Skip to content

Commit

Permalink
tests: fix debug_pod()
Browse files Browse the repository at this point in the history
The following message is an error on the debug_pod() function:
```
16:31:31 DEBUG: Pod cc-operator-controller-manager-67f7dff85b-qfnm4
16:31:31 + kubectl describe pods/cc-operator-controller-manager-67f7dff85b-qfnm4 '-n confidential-containers-system'
16:31:31 Error from server (NotFound): namespaces " confidential-containers-system" not found
```

It's passing '-n confidential-containers-system' as an single argument
to kubectl rather two (kubectl [...] '-n confidential-containers-system' vs kubectl [...] -n confidential-containers-system).

Signed-off-by: Wainer dos Santos Moschetta <[email protected]>
  • Loading branch information
wainersm committed Nov 16, 2023
1 parent f85bb0f commit 02ed4c9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/e2e/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ check_pods_are_ready() {
debug_pod() {
local pod="$1"
local ns="$2"
local ns_param=""
[ -n "$ns" ] && ns_param="-n $ns"

set -x
kubectl describe "pods/$1" ${ns:+"-n $ns"} || true
kubectl logs "pods/$1" ${ns:+"-n $ns"} || true
kubectl describe "pods/$1" $ns_param || true
kubectl logs "pods/$1" $ns_param || true
set +x
}

Expand Down

0 comments on commit 02ed4c9

Please sign in to comment.