[proxy] weavewait rewrites /etc/hosts so weave ip is returned first from 'hostname -i'

Adds a --no-rewrite-hosts flag to the proxy, and be default, removes the
docker IP from hosts. We only discard the docker host when it exists, so
--net=none works.
This commit is contained in:
Paul Bellamy committed 2015-07-10 13:57:20 +01:00
1 parent 75646d4786
commit e4458372e8
6 files changed
+121 -12

No files matched your search

+5 -1
View File
@@ -92,7 +92,11 @@ func (i *createContainerInterceptor) setWeaveWaitEntrypoint(container *docker.Co
}
if len(container.Entrypoint) == 0 || container.Entrypoint[0] != weaveWaitEntrypoint[0] {
container.Entrypoint = append(weaveWaitEntrypoint, container.Entrypoint...)
entrypoint := weaveWaitEntrypoint
if i.proxy.NoRewriteHosts {
entrypoint = append(entrypoint, "-h")
}
container.Entrypoint = append(entrypoint, container.Entrypoint...)
}
return nil
+7 -6
View File
@@ -29,12 +29,13 @@ var (
)
type Config struct {
ListenAddrs []string
NoDefaultIPAM bool
TLSConfig TLSConfig
Version string
WithDNS bool
WithoutDNS bool
ListenAddrs []string
NoDefaultIPAM bool
NoRewriteHosts bool
TLSConfig TLSConfig
Version string
WithDNS bool
WithoutDNS bool
}
type Proxy struct {