From a15fb9874a492ebfc7561aba333e974aaa425c76 Mon Sep 17 00:00:00 2001 From: higashi Date: Tue, 17 May 2016 16:02:25 +0900 Subject: [PATCH] Send error to waitConditionHandle when master.sh or worker.sh fails. --- kubecluster.yaml | 9 +++++++++ kubeminion.yaml | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/kubecluster.yaml b/kubecluster.yaml index 6b201cf..ebd0840 100644 --- a/kubecluster.yaml +++ b/kubecluster.yaml @@ -226,8 +226,17 @@ resources: str_replace: params: "$MASTER_CONTENT": {get_file: fragments/master.sh} + wc_notify: {get_attr: [master_wait_handle, curl_cli]} template: | #!/bin/bash + set -e + function finish { + if [ "$?" -ne 0 ] + then + wc_notify --data-binary '{"status": "FAILURE"}' + fi + } + trap "finish" EXIT source /etc/sysconfig/heat-params $MASTER_CONTENT diff --git a/kubeminion.yaml b/kubeminion.yaml index a02799d..c76901d 100644 --- a/kubeminion.yaml +++ b/kubeminion.yaml @@ -129,8 +129,17 @@ resources: str_replace: params: "$WORKER_CONTENT": {get_file: fragments/worker.sh} + wc_notify: {get_attr: [minion_wait_handle, curl_cli]} template: | #!/bin/bash + set -e + function finish { + if [ "$?" -ne 0 ] + then + wc_notify --data-binary '{"status": "FAILURE"}' + fi + } + trap "finish" EXIT source /etc/sysconfig/heat-params $WORKER_CONTENT