[COMMON] Fix deploy.sh/undeploy.sh scripts 65/123965/2
authorguillaume.lambert <guillaume.lambert@orange.com>
Wed, 8 Sep 2021 12:50:36 +0000 (14:50 +0200)
committerguillaume.lambert <guillaume.lambert@orange.com>
Thu, 9 Sep 2021 07:18:40 +0000 (09:18 +0200)
- fix bugs introduced after Honolulu
- use exit code 1 rather than 0 when scripts are not called properly

Issue-ID: OOM-2643
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: If4bff02bcf8c26b924ce6d5281d6ad35f3defa40

kubernetes/helm/plugins/deploy/deploy.sh
kubernetes/helm/plugins/undeploy/undeploy.sh

index 536be7b..2182dde 100755 (executable)
@@ -91,7 +91,7 @@ deploy() {
   # validate params
   if [ -z "$1" ] || [ -z "$2" ]; then
     usage
-    exit 0
+    exit 1
   fi
 
   RELEASE=$1
@@ -123,7 +123,7 @@ deploy() {
   fi
   # determine if set-last-applied flag is enabled
   SET_LAST_APPLIED="false"
-  if expr"$FLAGS" : ".*--set-last-applied.*" ; then
+  if expr "$FLAGS" : ".*--set-last-applied.*" ; then
     FLAGS="$(echo $FLAGS| sed -n 's/--set-last-applied//p')"
     SET_LAST_APPLIED="true"
   fi
index 72c6424..a3b0e3c 100755 (executable)
@@ -29,9 +29,9 @@ undeploy() {
   done
 }
 
-if [ $# < 1 ]; then
+if [ -z "$1" ]; then
   echo "Error: command 'undeploy' requires a release name"
-  exit 0
+  exit 1
 fi
 
 case "${1:-"help"}" in