summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
Diffstat (limited to 'libpod')
-rw-r--r--libpod/network/config.go5
-rw-r--r--libpod/network/netconflist.go7
-rw-r--r--libpod/networking_linux.go7
3 files changed, 15 insertions, 4 deletions
diff --git a/libpod/network/config.go b/libpod/network/config.go
index a08e684d8..ce8a4446c 100644
--- a/libpod/network/config.go
+++ b/libpod/network/config.go
@@ -131,8 +131,9 @@ func (f FirewallConfig) Bytes() ([]byte, error) {
// DNSNameConfig describes the dns container name resolution plugin config
type DNSNameConfig struct {
- PluginType string `json:"type"`
- DomainName string `json:"domainName"`
+ PluginType string `json:"type"`
+ DomainName string `json:"domainName"`
+ Capabilities map[string]bool `json:"capabilities"`
}
// Bytes outputs the configuration as []byte
diff --git a/libpod/network/netconflist.go b/libpod/network/netconflist.go
index 8187fdb39..13f472413 100644
--- a/libpod/network/netconflist.go
+++ b/libpod/network/netconflist.go
@@ -126,9 +126,12 @@ func NewFirewallPlugin() FirewallConfig {
// NewDNSNamePlugin creates the dnsname config with a given
// domainname
func NewDNSNamePlugin(domainName string) DNSNameConfig {
+ caps := make(map[string]bool, 1)
+ caps["aliases"] = true
return DNSNameConfig{
- PluginType: "dnsname",
- DomainName: domainName,
+ PluginType: "dnsname",
+ DomainName: domainName,
+ Capabilities: caps,
}
}
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go
index 28dca8dd8..4bc9381bd 100644
--- a/libpod/networking_linux.go
+++ b/libpod/networking_linux.go
@@ -105,6 +105,13 @@ func (r *Runtime) configureNetNS(ctr *Container, ctrNS ns.NetNS) ([]*cnitypes.Re
podName := getCNIPodName(ctr)
podNetwork := r.getPodNetwork(ctr.ID(), podName, ctrNS.Path(), ctr.config.Networks, ctr.config.PortMappings, requestedIP, requestedMAC)
+ aliases, err := ctr.runtime.state.GetAllNetworkAliases(ctr)
+ if err != nil {
+ return nil, err
+ }
+ if len(aliases) > 0 {
+ podNetwork.Aliases = aliases
+ }
results, err := r.netPlugin.SetUpPod(podNetwork)
if err != nil {