summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-02-27 23:20:58 +0000
committerGerrit Code Review <review@openstack.org>2019-02-27 23:20:58 +0000
commit8e9e7510a6f2a29eb31d3b310c68c51283f9e574 (patch)
tree1e0d36c4637acfc6d19d68c50765b3bd78aac1ce
parent07e29087774783740389af31b1108059a6ee9f98 (diff)
parent805d5168b9507ac0d923d178769df007e19f455c (diff)
Merge "(debug) debug-report.sh support ns filter"
-rwxr-xr-xpromenade/templates/roles/common/usr/local/bin/debug-report.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/promenade/templates/roles/common/usr/local/bin/debug-report.sh b/promenade/templates/roles/common/usr/local/bin/debug-report.sh
index d277ec0..b9a5ca8 100755
--- a/promenade/templates/roles/common/usr/local/bin/debug-report.sh
+++ b/promenade/templates/roles/common/usr/local/bin/debug-report.sh
@@ -3,11 +3,13 @@
3set -ux 3set -ux
4 4
5SUBDIR_NAME=debug-$(hostname) 5SUBDIR_NAME=debug-$(hostname)
6BASETEMP=${BASETEMP:-"/var/tmp"}
7NAMESPACE_PATTERN=${NAMESPACE_PATTERN:-'.*'}
6 8
7# NOTE(mark-burnett): This should add calicoctl to the path. 9# NOTE(mark-burnett): This should add calicoctl to the path.
8export PATH=${PATH}:/opt/cni/bin 10export PATH=${PATH}:/opt/cni/bin
9 11
10TEMP_DIR=$(mktemp -d) 12TEMP_DIR=$(mktemp -d -p "$BASETEMP")
11export TEMP_DIR 13export TEMP_DIR
12export BASE_DIR="${TEMP_DIR}/${SUBDIR_NAME}" 14export BASE_DIR="${TEMP_DIR}/${SUBDIR_NAME}"
13export HELM_DIR="${BASE_DIR}/helm" 15export HELM_DIR="${BASE_DIR}/helm"
@@ -18,7 +20,7 @@ mkdir -p "${BASE_DIR}"
18PARALLELISM_FACTOR=2 20PARALLELISM_FACTOR=2
19 21
20function get_namespaces () { 22function get_namespaces () {
21 kubectl get namespaces -o name | awk -F '/' '{ print $NF }' 23 kubectl get namespaces -o name | awk -F '/' '{ print $NF }' | grep -E "$NAMESPACE_PATTERN"
22} 24}
23 25
24function get_pods () { 26function get_pods () {
@@ -125,3 +127,4 @@ fi
125wait 127wait
126 128
127tar zcf "${SUBDIR_NAME}.tgz" -C "${TEMP_DIR}" "${SUBDIR_NAME}" 129tar zcf "${SUBDIR_NAME}.tgz" -C "${TEMP_DIR}" "${SUBDIR_NAME}"
130echo "Report collected in $TEMP_DIR/${SUBDIR_NAME}.tgz"