From d5fcbb8d6ff017704fc1fc37cda5618a57c96f69 Mon Sep 17 00:00:00 2001
From: Brendon Lloyd <blloyd@revacomm.com>
Date: Thu, 21 Oct 2021 20:38:25 +0000
Subject: [PATCH] Resolve "wait_crd in BB CI doesn't exit on failure"

---
 tests/deploy/02_wait_for_helmreleases.sh | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tests/deploy/02_wait_for_helmreleases.sh b/tests/deploy/02_wait_for_helmreleases.sh
index 5f2dfd9e54..39adc2a0b9 100755
--- a/tests/deploy/02_wait_for_helmreleases.sh
+++ b/tests/deploy/02_wait_for_helmreleases.sh
@@ -135,12 +135,11 @@ function wait_daemonset(){
 
 # Check for and run the wait_project function within <repo>/tests/wait.sh to wait for custom resources
 function wait_crd(){
-  set +e
   yq e '. | keys | .[] | ... comments=""' "${VALUES_FILE}" | while IFS= read -r package; do
     if [[ "$(yq e ".${package}.enabled" "${VALUES_FILE}")" == "true" ]]; then
       gitrepo=$(yq e ".${package}.git.repo" "${VALUES_FILE}")
       version=$(yq e ".${package}.git.tag" "${VALUES_FILE}")
-      if [[ -z "$version" ]]; then
+      if [[ -z "$version" || "$version" == "null" ]]; then
         version=$(yq e ".${package}.git.branch" "${VALUES_FILE}")
       fi
       if [[ -z "$version" || "$version" == "null" ]]; then
@@ -156,7 +155,6 @@ function wait_crd(){
       fi
     fi
   done
-  set -e
 }
 
 
-- 
GitLab