summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Hussey <sh8121@att.com>2019-01-03 10:39:10 -0600
committerScott Hussey <sh8121@att.com>2019-01-03 10:45:00 -0600
commit805d5168b9507ac0d923d178769df007e19f455c (patch)
tree60a2dffaf11ba6422b696c8a6a49ce5700424c00
parentb5a05dc762f1b8ca05de90febbef519ea336495b (diff)
(debug) debug-report.sh support ns filter
- Support NAMESPACE_FILTER as a grep filter for which namespaces to collect pod logs for - Default report location to /var/tmp and support override with BASETEMP Change-Id: I8c302313c3c0492a9db856332067f77fb5a41a19
Notes
Notes (review): Code-Review+1: Evgeniy L <eli@mirantis.com> Code-Review+2: Bryan Strassner <strassner.bryan@gmail.com> Code-Review+1: Vladyslav Drok <vdrok@mirantis.com> Code-Review+1: Dustin Specker <dustin.specker@att.com> Code-Review+2: Sean Eagan <sean.eagan@att.com> Workflow+1: Sean Eagan <sean.eagan@att.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 27 Feb 2019 23:20:58 +0000 Reviewed-on: https://review.openstack.org/628219 Project: openstack/airship-promenade Branch: refs/heads/master
-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"