-
Notifications
You must be signed in to change notification settings - Fork 33
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
Substitute $HOST and $PORT* in healthcheck command #232
Conversation
{ | ||
name: "with ports and host", | ||
args: args{ | ||
s: "nc $HOST $PORT0 && nc $HOST $PORT1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is rare scenarion but what if command has escaped variable name? e.g.: echo \$HOST
or echo '$HOST'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that can be a problem... but solving this can be very difficult. I found this package https://godoc.org/github.com/mvdan/sh/syntax to parse and "understand" shell but API is not simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janisz documentation done ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@guilhem Thanks! I really like this feature and I'm in favor of merging it.
We need to add documentation that describes how it works with information when it could fail. Best if we can provide solution that will works the same as in Marathon/Mesos. I mean resolved commands will be the same.
I'm not sure how will this works if user has bridged network, what values has $PORT
and $HOST
then?
I don't know in case of bridged network... I just sure that it doesn't work for them either in current situation ;) Marathon is running healthcheck shell commands with same execution context than a task... it's really hard to reproduce it. |
You are right. This feature is not working right now so adding it should not damage any Marathon-Consul installation. |
@guilhem Thanks! |
No description provided.