From 34fe5274e08af6086b58414872584ecbabf334e7 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 11 Jul 2017 16:22:21 +0300 Subject: [PATCH] take into account status codes by leveraging `--fail` curl option (Refs #37) --- mintnet-kubernetes/app.template.yaml | 4 ++-- mintnet-kubernetes/examples/basecoin/app.yaml | 8 ++++---- mintnet-kubernetes/examples/counter/app.yaml | 4 ++-- mintnet-kubernetes/examples/dummy/app.yaml | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mintnet-kubernetes/app.template.yaml b/mintnet-kubernetes/app.template.yaml index 781767100..b55fb67e3 100644 --- a/mintnet-kubernetes/app.template.yaml +++ b/mintnet-kubernetes/app.template.yaml @@ -129,11 +129,11 @@ spec: # wait until validator generates priv/pub key pair set +e - curl -s "http://$v.$fqdn_suffix/pub_key.json" > /dev/null + curl -s --fail "http://$v.$fqdn_suffix/pub_key.json" > /dev/null ERR=$? while [ "$ERR" != 0 ]; do sleep 5 - curl -s "http://$v.$fqdn_suffix/pub_key.json" > /dev/null + curl -s --fail "http://$v.$fqdn_suffix/pub_key.json" > /dev/null ERR=$? done set -e diff --git a/mintnet-kubernetes/examples/basecoin/app.yaml b/mintnet-kubernetes/examples/basecoin/app.yaml index fe667a8e4..1e35c4e27 100644 --- a/mintnet-kubernetes/examples/basecoin/app.yaml +++ b/mintnet-kubernetes/examples/basecoin/app.yaml @@ -188,11 +188,11 @@ spec: # wait until validator generates priv/pub key pair set +e - curl -s "http://$v.$fqdn_suffix/pub_key.json" > /dev/null + curl -s --fail "http://$v.$fqdn_suffix/pub_key.json" > /dev/null ERR=$? while [ "$ERR" != 0 ]; do sleep 5 - curl -s "http://$v.$fqdn_suffix/pub_key.json" > /dev/null + curl -s --fail "http://$v.$fqdn_suffix/pub_key.json" > /dev/null ERR=$? done set -e @@ -247,11 +247,11 @@ spec: # wait until pod starts to serve its pub_key set +e - curl -s "http://$pod.$fqdn_suffix/app_pub_key.json" > /dev/null + curl -s --fail "http://$pod.$fqdn_suffix/app_pub_key.json" > /dev/null ERR=$? while [ "$ERR" != 0 ]; do sleep 5 - curl -s "http://$pod.$fqdn_suffix/app_pub_key.json" > /dev/null + curl -s --fail "http://$pod.$fqdn_suffix/app_pub_key.json" > /dev/null ERR=$? done set -e diff --git a/mintnet-kubernetes/examples/counter/app.yaml b/mintnet-kubernetes/examples/counter/app.yaml index 0a92631ab..2e1bdc6d3 100644 --- a/mintnet-kubernetes/examples/counter/app.yaml +++ b/mintnet-kubernetes/examples/counter/app.yaml @@ -121,11 +121,11 @@ spec: # wait until validator generates priv/pub key pair set +e - curl -s "http://$v.$fqdn_suffix/pub_key.json" > /dev/null + curl -s --fail "http://$v.$fqdn_suffix/pub_key.json" > /dev/null ERR=$? while [ "$ERR" != 0 ]; do sleep 5 - curl -s "http://$v.$fqdn_suffix/pub_key.json" > /dev/null + curl -s --fail "http://$v.$fqdn_suffix/pub_key.json" > /dev/null ERR=$? done set -e diff --git a/mintnet-kubernetes/examples/dummy/app.yaml b/mintnet-kubernetes/examples/dummy/app.yaml index 27ecdc0a1..d03be8ed5 100644 --- a/mintnet-kubernetes/examples/dummy/app.yaml +++ b/mintnet-kubernetes/examples/dummy/app.yaml @@ -121,11 +121,11 @@ spec: # wait until validator generates priv/pub key pair set +e - curl -s "http://$v.$fqdn_suffix/pub_key.json" > /dev/null + curl -s --fail "http://$v.$fqdn_suffix/pub_key.json" > /dev/null ERR=$? while [ "$ERR" != 0 ]; do sleep 5 - curl -s "http://$v.$fqdn_suffix/pub_key.json" > /dev/null + curl -s --fail "http://$v.$fqdn_suffix/pub_key.json" > /dev/null ERR=$? done set -e