From 3cd74783ff582c6842fc7e296de97a643be214fc Mon Sep 17 00:00:00 2001 From: Girish Thimmegowda <60695752+onmyquest@users.noreply.github.com> Date: Mon, 17 Jun 2024 11:59:39 +0800 Subject: [PATCH] Update get_support_bundle.sh Fixed Backend version check regular expression. --- 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 a313f005..fae131c6 100755 --- a/support_bundle/get_support_bundle.sh +++ b/support_bundle/get_support_bundle.sh @@ -148,7 +148,7 @@ main() { # If API key is supplied, check the backend version, and send a GET to the relevant endpoints. if [[ ! -z ${API_KEY} ]]; then - BACKEND_VERSION=$(kubectl ${CONTEXT_OPTS} ${KUBE_OPTS} get deployment sysdigcloud-api -ojsonpath='{.spec.template.spec.containers[0].image}' | awk 'match($0, /[0-9]\.[0-9]\.[0-9](\.[0-9]+)?/) {print substr($0, RSTART, RLENGTH)}') || true + BACKEND_VERSION=$(kubectl ${KUBE_OPTS} get deployment sysdigcloud-api -ojsonpath='{.spec.template.spec.containers[0].image}' | awk 'match($0, /[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?/) {print substr($0, RSTART, RLENGTH)}') || true if [[ "$BACKEND_VERSION" =~ ^(6) ]]; then API_URL=$(kubectl ${KUBE_OPTS} get cm sysdigcloud-collector-config -ojsonpath='{.data.collector-config\.conf}' | awk 'p&&$0~/"/{gsub("\"","");print} /{/{p=0} /sso/{p=1}' | grep serverName | awk '{print $3}') # Check that the API_KEY for the Super User is valid and exit