From 86674e3c331a68e9776e77c77e6ed88c8bed9f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9za=20B=C3=BAza?= Date: Sun, 8 May 2016 22:14:44 +0200 Subject: [PATCH] Fix domain name handling Newer versions of Docker does not split the given hostname by the dot character, but it places the whole hostname string to the Config.Hostname setting, leaving Config.Domainname empty. This commit makes sure that a valid FQDN is put together regardless of Docker config. --- spy.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spy.go b/spy.go index 096c4ee..0cc5a08 100644 --- a/spy.go +++ b/spy.go @@ -46,7 +46,10 @@ func (s *Spy) mutateContainerInCache(id string, status string) { return } - name := container.Config.Hostname + "." + container.Config.Domainname + "." + name := container.Config.Hostname + "." + if len(container.Config.Domainname) > 0 { + name += container.Config.Domainname + "." + } var running = regexp.MustCompile("start|^Up.*$") var stopping = regexp.MustCompile("die")