-
Notifications
You must be signed in to change notification settings - Fork 670
add proxy-env and proxy-config which query weaveproxy for port #848
Conversation
proxy-config) | ||
proxy_addr "-H=" | ||
exit $? | ||
;; |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
You later said that running it locally won't work due to #805. I agree, that doing #805 first is a good plan. |
4a6c3b6
to
0890542
Compare
The situation this doesn't handle, is if you have: $ weave_on <remote_host> launch-proxy -L 127.0.0.1:12375
083896110ec5162b18dec9b833433812314a82a8be719642ff9effdb5d481425
$ weave proxy-env
export DOCKER_HOST=tcp://127.0.0.1:12375 Which won't work if you are not on the remote host. But aside from throwing an error, there isn't much we can do in that situation. |
ec69408
to
7a50aaf
Compare
|
||
CMD="run -e WEAVE_CIDR=10.2.1.4/24 $BASE_IMAGE $CHECK_ETHWE_UP" | ||
assert_raises "eval '$(weave_on $HOST1 proxy-env)' ; docker $CMD" | ||
assert_raises "docker $(weave_on $HOST1 proxy-config) $CMD" |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
I don't understand this comment. What does Also, it seems to me that |
Yeah. Needs a bit of a rework now that #805 is done. |
We could hold our noses and extract the listen address from the proxy's docker logs. Seems preferable to me to doing a lot of arg parsing and introducing bogus |
@@ -805,6 +811,18 @@ proxy_args() { | |||
done | |||
} | |||
|
|||
proxy_addr() { | |||
if addr=$(docker logs weaveproxy | grep -oE "proxy listening on .*"); then |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@@ -805,6 +811,18 @@ proxy_args() { | |||
done | |||
} | |||
|
|||
proxy_addr() { | |||
if addr=$(docker logs weaveproxy | head -n3 | grep -oE "proxy listening on .*"); then |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
docs need updating |
globally adjust your `DOCKER_HOST` to point at the proxy, e.g. | ||
All docker commands can be run via the proxy, so it is safe to use | ||
`weave proxy-env` to globally adjust your `DOCKER_HOST` to point at | ||
the proxy, e.g. |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
It's ugly, but beats arg-parsing, inspecting the container and piecing the address together from exposed ports. We could just use the host from DOCKER_HOST, but that will fail in the case of a host with multiple IPs, where the proxy only listens on one.
done? |
Yes. |
add proxy-env and proxy-config Closes #753.
If the overall approach looks fine, I want to modify the tests to use this.
Closes #753