From 624a16feb327e93f3cb9ea7a0ec2cc2eb1e28e45 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 19 Apr 2024 09:09:39 +0200 Subject: [PATCH] Let "depoly-setup.sh" and "undeploy.sh" fail on error Ignoring errors seems not best. It can make it harder to find problems with the script. If a command in the script is known to fail for valid reasons, then that should be treated specially (for example, with `|| :`). By default, treat any unexpected failure as fatal and propagate the failure to the caller. Fixes: 88441502023d ('Add RBAC for cluster resource') --- hack/deploy-setup.sh | 2 +- hack/undeploy.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hack/deploy-setup.sh b/hack/deploy-setup.sh index 0ff96fd73..2c2fc7d8d 100755 --- a/hack/deploy-setup.sh +++ b/hack/deploy-setup.sh @@ -3,7 +3,7 @@ # to deploy. It assumes it is capable of login as a # user who has the cluster-admin role -# set -euxo pipefail +set -eo pipefail source "$(dirname $0)/common" diff --git a/hack/undeploy.sh b/hack/undeploy.sh index 449137ec8..80cc08293 100755 --- a/hack/undeploy.sh +++ b/hack/undeploy.sh @@ -1,5 +1,6 @@ #!/bin/bash -#set -euxo pipefail + +set -eo pipefail source "$(dirname $0)/common"