Strip trailing period from hostname generated from weavedns domain.
We strip at the calling point rather than in the server, because DNS servers do see the domain as ending with a '.' representing the root.
This commit is contained in:
1 parent
dd9adf6a65
commit
79db00a90e
3 files changed
+5
-3
No files matched your search
@@ -94,7 +94,8 @@ func (i *createContainerInterceptor) setWeaveDNS(container *createContainerReque
|
||||
name := r.URL.Query().Get("name")
|
||||
if container.Hostname == "" && name != "" {
|
||||
container.Hostname = name
|
||||
container.Domainname = i.getDNSDomain()
|
||||
// Strip trailing period because it's unusual to see it used on the end of a host name
|
||||
container.Domainname = strings.TrimSuffix(i.getDNSDomain(), ".")
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user