From 7b6039337aa47c3b702ab6566b70a715f5b93abc Mon Sep 17 00:00:00 2001 From: Diego Martin Hernandez Date: Fri, 31 May 2024 13:43:48 +0100 Subject: [PATCH 1/5] Update get_support_bundle.sh Now if the backend version is higher than 6.5, it should get the sysdigcloud-values secret which include different settings such as JVM etc... --- support_bundle/get_support_bundle.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/support_bundle/get_support_bundle.sh b/support_bundle/get_support_bundle.sh index a313f00..331fe8f 100755 --- a/support_bundle/get_support_bundle.sh +++ b/support_bundle/get_support_bundle.sh @@ -480,6 +480,12 @@ main() { echo "Fetching the sysdigcloud-config ConfigMap" kubectl ${KUBE_OPTS} get configmap sysdigcloud-config -o yaml | grep -v password | grep -v apiVersion > ${LOG_DIR}/config.yaml || true + # Collect the sysdigcloud-values secret, and write to the log directory if the backend version is 6.5 or higher + if [[ "$BACKEND_VERSION" =~ ^(6.5) ]]; then + echo "Fetching the sysdigcloud-values Secret" + kubectl -n sysdigcloud get secret sysdigcloud-values -o jsonpath='{.data.values\.yaml}' | base64 -d > ${LOG_DIR}/values.yaml || true + fi + # Generate the bundle name, create a tarball, and remove the temp log directory BUNDLE_NAME=$(date +%s)_sysdig_cloud_support_bundle.tgz echo "Creating the ${BUNDLE_NAME} archive now" From 4617d0ba39f8f76621a5f12d1d4270c96fb85833 Mon Sep 17 00:00:00 2001 From: Diego Martin Hernandez Date: Fri, 31 May 2024 14:16:41 +0100 Subject: [PATCH 2/5] Replaced hardcoded namespace with KUBE_OPTS --- support_bundle/get_support_bundle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support_bundle/get_support_bundle.sh b/support_bundle/get_support_bundle.sh index 331fe8f..3e0e642 100755 --- a/support_bundle/get_support_bundle.sh +++ b/support_bundle/get_support_bundle.sh @@ -483,7 +483,7 @@ main() { # Collect the sysdigcloud-values secret, and write to the log directory if the backend version is 6.5 or higher if [[ "$BACKEND_VERSION" =~ ^(6.5) ]]; then echo "Fetching the sysdigcloud-values Secret" - kubectl -n sysdigcloud get secret sysdigcloud-values -o jsonpath='{.data.values\.yaml}' | base64 -d > ${LOG_DIR}/values.yaml || true + kubectl ${KUBE_OPTS} get secret sysdigcloud-values -o jsonpath='{.data.values\.yaml}' | base64 -d > ${LOG_DIR}/values.yaml || true fi # Generate the bundle name, create a tarball, and remove the temp log directory From b2d8bd1c8f9be308d19e22de34ed03ccb486b1f2 Mon Sep 17 00:00:00 2001 From: Diego Martin Hernandez Date: Fri, 14 Jun 2024 13:58:48 +0100 Subject: [PATCH 3/5] Update get_support_bundle.sh --- support_bundle/get_support_bundle.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/support_bundle/get_support_bundle.sh b/support_bundle/get_support_bundle.sh index 3e0e642..b9eb9fd 100755 --- a/support_bundle/get_support_bundle.sh +++ b/support_bundle/get_support_bundle.sh @@ -481,7 +481,9 @@ main() { kubectl ${KUBE_OPTS} get configmap sysdigcloud-config -o yaml | grep -v password | grep -v apiVersion > ${LOG_DIR}/config.yaml || true # Collect the sysdigcloud-values secret, and write to the log directory if the backend version is 6.5 or higher - if [[ "$BACKEND_VERSION" =~ ^(6.5) ]]; then + major=$(echo $version | awk -F. '{ print $1 }') + minor=$(echo $version | awk -F. '{ print $2 }') + if [[ $major -gt 6]] || [[ $major -eq 6]] && [[ $minor -ge 5 ]]; then echo "Fetching the sysdigcloud-values Secret" kubectl ${KUBE_OPTS} get secret sysdigcloud-values -o jsonpath='{.data.values\.yaml}' | base64 -d > ${LOG_DIR}/values.yaml || true fi From 912749b95489f4cbd602a50ac06aacd8adafe714 Mon Sep 17 00:00:00 2001 From: Diego Martin Hernandez Date: Mon, 17 Jun 2024 09:33:24 +0100 Subject: [PATCH 4/5] Update get_support_bundle.sh --- support_bundle/get_support_bundle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support_bundle/get_support_bundle.sh b/support_bundle/get_support_bundle.sh index b9eb9fd..4b16d4d 100755 --- a/support_bundle/get_support_bundle.sh +++ b/support_bundle/get_support_bundle.sh @@ -483,7 +483,7 @@ main() { # Collect the sysdigcloud-values secret, and write to the log directory if the backend version is 6.5 or higher major=$(echo $version | awk -F. '{ print $1 }') minor=$(echo $version | awk -F. '{ print $2 }') - if [[ $major -gt 6]] || [[ $major -eq 6]] && [[ $minor -ge 5 ]]; then + if [[ $major -ge 6]] && [[ $minor -ge 5 ]]; then echo "Fetching the sysdigcloud-values Secret" kubectl ${KUBE_OPTS} get secret sysdigcloud-values -o jsonpath='{.data.values\.yaml}' | base64 -d > ${LOG_DIR}/values.yaml || true fi From 337d416512f64e2f84b1f06484d7eacba694b4d1 Mon Sep 17 00:00:00 2001 From: Diego Martin Hernandez Date: Mon, 17 Jun 2024 18:02:59 +0100 Subject: [PATCH 5/5] Update support_bundle/get_support_bundle.sh Co-authored-by: Mark Breitung --- support_bundle/get_support_bundle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support_bundle/get_support_bundle.sh b/support_bundle/get_support_bundle.sh index 4b16d4d..cefcdd4 100755 --- a/support_bundle/get_support_bundle.sh +++ b/support_bundle/get_support_bundle.sh @@ -483,7 +483,7 @@ main() { # Collect the sysdigcloud-values secret, and write to the log directory if the backend version is 6.5 or higher major=$(echo $version | awk -F. '{ print $1 }') minor=$(echo $version | awk -F. '{ print $2 }') - if [[ $major -ge 6]] && [[ $minor -ge 5 ]]; then + if [[ $major -gt 6 ]] || ( [[ $major -ge 6 ]] && [[ $minor -ge 5 ]] ); then echo "Fetching the sysdigcloud-values Secret" kubectl ${KUBE_OPTS} get secret sysdigcloud-values -o jsonpath='{.data.values\.yaml}' | base64 -d > ${LOG_DIR}/values.yaml || true fi