X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=deploy%2Fbaremetal-operator%2Fbaremetal-operator.sh;h=34c5977d8acf7cc13ce80e0c4ac1737128103145;hb=77249ba85760fc2111a98dc6719670312f64a31a;hp=d912d974c0b0af09d9d9ef2f211fa7691c287e43;hpb=3132fc5e4d956ad3181a9ec0c5f234581f8947b1;p=icn.git diff --git a/deploy/baremetal-operator/baremetal-operator.sh b/deploy/baremetal-operator/baremetal-operator.sh index d912d97..34c5977 100755 --- a/deploy/baremetal-operator/baremetal-operator.sh +++ b/deploy/baremetal-operator/baremetal-operator.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -eux -o pipefail +set -eEux -o pipefail SCRIPTDIR="$(readlink -f $(dirname ${BASH_SOURCE[0]}))" LIBDIR="$(dirname $(dirname ${SCRIPTDIR}))/env/lib" @@ -7,6 +7,13 @@ LIBDIR="$(dirname $(dirname ${SCRIPTDIR}))/env/lib" source $LIBDIR/logging.sh source $LIBDIR/common.sh +trap err_exit ERR +function err_exit { + if command -v kubectl; then + kubectl get all -n baremetal-operator-system + fi +} + # This may be used to update the in-place Bare Metal Operator YAML # files from the upstream project function build_source { @@ -25,7 +32,7 @@ function deploy { } function clean { - kustomize build ${SCRIPTDIR}/icn | kubectl delete -f - + kustomize build ${SCRIPTDIR}/icn | kubectl delete --ignore-not-found=true -f - } case $1 in