summaryrefslogtreecommitdiff
path: root/pkg/network/netconflist.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-10-29 14:46:38 +0100
committerGitHub <noreply@github.com>2019-10-29 14:46:38 +0100
commit815bd568b225710fcc8b425c1d5143b2c8606de1 (patch)
tree2fffce829ce1282e6d635bb102fb1b32c8bbd229 /pkg/network/netconflist.go
parent25f1b1540a700a80904cf0b2862a73da03200bb9 (diff)
parent2f6b8b94e87bb3645d34e59dd3b748dba4aa4d2c (diff)
downloadpodman-815bd568b225710fcc8b425c1d5143b2c8606de1.tar.gz
podman-815bd568b225710fcc8b425c1d5143b2c8606de1.tar.bz2
podman-815bd568b225710fcc8b425c1d5143b2c8606de1.zip
Merge pull request #4187 from baude/dnspluginenable
enable dnsplugin for network create
Diffstat (limited to 'pkg/network/netconflist.go')
-rw-r--r--pkg/network/netconflist.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/pkg/network/netconflist.go b/pkg/network/netconflist.go
index c3b11b409..e19051b88 100644
--- a/pkg/network/netconflist.go
+++ b/pkg/network/netconflist.go
@@ -2,6 +2,8 @@ package network
import (
"net"
+ "os"
+ "path/filepath"
)
// NcList describes a generic map
@@ -111,3 +113,22 @@ func NewFirewallPlugin() FirewallConfig {
Backend: "iptables",
}
}
+
+// NewDNSNamePlugin creates the dnsname config with a given
+// domainname
+func NewDNSNamePlugin(domainName string) DNSNameConfig {
+ return DNSNameConfig{
+ PluginType: "dnsname",
+ DomainName: domainName,
+ }
+}
+
+// HasDNSNamePlugin looks to see if the dnsname cni plugin is present
+func HasDNSNamePlugin(paths []string) bool {
+ for _, p := range paths {
+ if _, err := os.Stat(filepath.Join(p, "dnsname")); err == nil {
+ return true
+ }
+ }
+ return false
+}