This repository has been archived by the owner on Sep 29, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HeliosSoloDeployment: don't use gateway IP in Docker for Mac
When DOCKER_HOST is a unix socket path, then HeliosSoloDeployment ends up using the IP address of the gateway of the probe container as the address that deployed-containers can be reached at (for example, when TemporaryJob probes the container's port mappings). This fails for Docker for Mac (and probably other environments as well) where the gateway address is 172.17.0.1 (when using the default bridged network settings) which is not reachable from the host. This solution of testing explicitly for Docker for Mac feels a bit hacky as it does not address the root question. The root question that HeliosSoloDeployment asks is what address should be used to communciate with ports mapped from the job's container to the host running helios-solo. In most cases the address of `DOCKER_HOST` is used, and there is an existing special case to use the probe container's gateway when the address of DOCKER_HOST is `localhost`. This special case fails with Docker for Mac and it's `DOCKER_HOST` of `unix:///var/run/docker.sock`, but there are other cases when the gateway *should* be used when DOCKER_HOST is a unix path (judging from the logic in `helios-env` and `helios-up`. However it does not seem clear what the generalized conditions are for when the probe container's gateway address should be used for `HELIOS_HOST_ADDRESS`, hence this hack.
- Loading branch information