Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: shell error in wait-for-grafana job. #109

Merged
merged 3 commits into from Feb 22, 2019

Conversation

Projects
None yet
3 participants
@lentil1016
Copy link
Contributor

commented Dec 28, 2018

What is this PR do

Fix:

  • Missing space which makes this waiting job not actually waiting.
  • Change the excepted http code to 302 to let waiting job completed as intended.

Running result of this PR

+ curl -sw '%{http_code}' http://grafana:3000 -o /dev/null
.
+ '[' 000 -ne 302 ]
+ echo .
+ sleep 15
+ curl -sw '%{http_code}' http://grafana:3000 -o /dev/null
.
+ '[' 000 -ne 302 ]
+ echo .
+ sleep 15
+ curl -sw '%{http_code}' http://grafana:3000 -o /dev/null
+ '[' 302 -ne 302 ]

@lentil1016 lentil1016 changed the title Fix: shell error in wait-for-grafana job. [WIP]Fix: shell error in wait-for-grafana job. Dec 28, 2018

@lentil1016 lentil1016 changed the title [WIP]Fix: shell error in wait-for-grafana job. Fix: shell error in wait-for-grafana job. Dec 28, 2018

@lentil1016

This comment has been minimized.

Copy link
Contributor Author

commented Dec 28, 2018

I believe it's ready for review now. 😄

@@ -23,7 +23,7 @@ spec:
- -c
- >
set -x;
while [ $(curl -sw '%{http_code}' "http://grafana:3000" -o /dev/null) -ne 200]; do
while [ $(curl -sw '%{http_code}' "http://grafana:3000" -o /dev/null) -ne 302 ]; do

This comment has been minimized.

Copy link
@ikarlashov

ikarlashov Feb 18, 2019

It's better to use while [ $(curl -L -sw '%{http_code}' "http://grafana:3000" -o /dev/null) -ne 200 ]; do - to add key -L to follow redirection. That's more safe.

lentil1016 added some commits Feb 19, 2019

@lentil1016

This comment has been minimized.

Copy link
Contributor Author

commented Feb 19, 2019

@ikarlashov Thanks. I have redone my last commit.

@pipo02mix pipo02mix merged commit 26d0fd5 into giantswarm:master Feb 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.