Merge pull request #1126 from weaveworks/issues/1018-more-flexible-hostname-derivation

[proxy] More flexible container name -> hostname derivation

Closes #1018.
This commit is contained in:
Matthias Radestock committed 2015-07-14 17:31:53 +01:00
commit 7ae06ef00d
6 files changed
+86 -10

No files matched your search

+3 -1
View File
@@ -60,7 +60,9 @@ func (i *createContainerInterceptor) InterceptRequest(r *http.Request) error {
if err := i.setWeaveWaitEntrypoint(container.Config); err != nil {
return err
}
if err := i.setWeaveDNS(&container, r.URL.Query().Get("name")); err != nil {
containerName := r.URL.Query().Get("name")
hostname := i.proxy.hostnameMatchRegexp.ReplaceAllString(containerName, i.proxy.HostnameReplacement)
if err := i.setWeaveDNS(&container, hostname); err != nil {
return err
}
}