Skip to content

Commit

Permalink
Remove hard-coded namespace from debug example. (#1009)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Arnold <marnold@redhat.com>
Co-authored-by: Matthew Arnold <marnold@redhat.com>
  • Loading branch information
openshift-cherrypick-robot and mrnold committed May 16, 2023
1 parent 46baadc commit 19fbffa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions must-gather/collection-scripts/debug/tail_failed_pods
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash

skip_tls="${1:-false}"
namespace="${1:-openshift-adp}"
skip_tls="${2:-false}"

for pod in $(oc get pods --insecure-skip-tls-verify=${skip_tls} -n openshift-adp -o jsonpath='{.items[?(.status.containerStatuses[0].lastState.terminated.reason=="Error")].metadata.name}'); do
for pod in $(oc get pods --insecure-skip-tls-verify=${skip_tls} -n ${namespace} -o jsonpath='{.items[?(.status.containerStatuses[0].lastState.terminated.reason=="Error")].metadata.name}'); do
echo "***"
echo "* Last logs from failed pod openshift-adp/${pod}:"
oc logs -n openshift-adp --insecure-skip-tls-verify=${skip_tls} $pod --tail=10
echo "* Last logs from failed pod ${namespace}/${pod}:"
oc logs -n ${namespace} --insecure-skip-tls-verify=${skip_tls} $pod --tail=10
echo -e "\n\n\n"
done

0 comments on commit 19fbffa

Please sign in to comment.