-
Notifications
You must be signed in to change notification settings - Fork 472
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
[dgoss] Use inspect instead of top in health check #473
[dgoss] Use inspect instead of top in health check #473
Conversation
Doesn't look like the Travis test includes dgoss. I should have mentioned too that I tested with the 3.7.0 release of the goss executable, didn't compile it from source. |
Anything additional I should here? |
I have the same issue as @jgeorgeson, but I was able to resolve it by changing the following: |
thx @nathysOne , ran into the same issue and removing the docker top fixed it.:) |
f52ed37
to
64ac917
Compare
Looks good to me. I'll test/merge this after testing locally. Travis test seems to be broken. Don't worry about the PR successful passing tests. |
For what it's worth, this PR seems to have broken the dgoss health check for me. It always said container I committed a fix directly to master. The commit with the fix is here if you're curious on the cause: a4a501a |
Hm, it appears to be the escaped quotes on the format string [19:39:32]> justin@chymera in ~
$ docker inspect -f \"{{.State.Running}}\" 7cf3008d0e6fde1693d09b6a357858900c266f2f41b7aff4d59965e6c5cd3a59
"true"
[19:39:38]> justin@chymera in ~
$ docker inspect -f "{{.State.Running}}" 7cf3008d0e6fde1693d09b6a357858900c266f2f41b7aff4d59965e6c5cd3a59
true
[19:39:44]> justin@chymera in ~
$ if [ "true" != "$(docker inspect -f \"{{.State.Running}}\" 7cf3008d0e6fde1693d09b6a357858900c266f2f41b7aff4d59965e6c5cd3a59)" ]; then echo ended; else echo running; fi
ended
[19:40:46]> justin@chymera in ~
$ if [ "true" != "$(docker inspect -f "{{.State.Running}}" 7cf3008d0e6fde1693d09b6a357858900c266f2f41b7aff4d59965e6c5cd3a59)" ]; then echo ended; else echo running; fi
running I just have it ingrained to wrap a command output in quotes for equality tests in case the command doesn't produce any output. |
Good point, fixed: 9dddd81 |
Just started using Goss, very nice! I came across #376 trying to publish JUnit results in my CI. This change tests if the container is running without producing any output to be redirected. This change is working in my environment. Additionally tested with your dgoss-examples repo nginx goss.yaml