Change KUD plugin from onap4k8s to emco.
[icn.git] / cmd / bpa-operator / e2etest / bpa_bmh_verifier.sh
index 5dece3a..edf93df 100755 (executable)
@@ -1,4 +1,5 @@
-#!/bin/bash
+#!/usr/bin/env bash
+set -eu -o pipefail
 
 CLUSTER_NAME=test-bmh-cluster
 
@@ -25,9 +26,7 @@ then
    KUBECONFIG=--kubeconfig=/opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/admin.conf
    APISERVER=$(kubectl ${KUBECONFIG} config view --minify -o jsonpath='{.clusters[0].cluster.server}')
    TOKEN=$(kubectl ${KUBECONFIG} get secret $(kubectl ${KUBECONFIG} get serviceaccount default -o jsonpath='{.secrets[0].name}') -o jsonpath='{.data.token}' | base64 --decode )
-   call_api $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure
-   ret=$?
-   if [[ $ret != 0 ]];
+   if ! call_api $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure;
    then
      printf "\nKubernetes Cluster Install did not complete successfully\n"
    else