From e728e01a8c839052b41b5ce488b3ba20807cbb1b Mon Sep 17 00:00:00 2001 From: Hector Garzon Date: Wed, 6 Jul 2022 10:44:47 +0200 Subject: [PATCH] assign value to error variable in all cases --- 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 8cae34e8..bfc4e87b 100755 --- a/support_bundle/get_support_bundle.sh +++ b/support_bundle/get_support_bundle.sh @@ -139,7 +139,7 @@ main() { KUBE_OPTS="--namespace ${NAMESPACE} ${CONTEXT_OPTS}" #verify that the provided namespace exists - KUBE_OUTPUT=$(kubectl ${CONTEXT_OPTS} get namespace ${NAMESPACE} --no-headers >/dev/null 2>&1) && RETVAL=$? || { RETVAL=$? && error=1; } + KUBE_OUTPUT=$(kubectl ${CONTEXT_OPTS} get namespace ${NAMESPACE} --no-headers >/dev/null 2>&1) && RETVAL=$? && error=0 || { RETVAL=$? && error=1; } if [[ ${error} -eq 1 ]]; then echo "We could not determine the namespace. Please check the spelling and try again. Return Code: ${RETVAL}"