aboutsummaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-03-26 13:55:19 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-03-27 10:12:18 -0400
commit0cd92eae65b31cdbaa19e3cccb0e3234196a6d17 (patch)
tree97ad5dec432154ba5bc88e758d5110494d45d35f /libpod/options.go
parent86f03e0e526bbf39ea8a6cb18e3067a7e37bfd89 (diff)
downloadpodman-0cd92eae65b31cdbaa19e3cccb0e3234196a6d17.tar.gz
podman-0cd92eae65b31cdbaa19e3cccb0e3234196a6d17.tar.bz2
podman-0cd92eae65b31cdbaa19e3cccb0e3234196a6d17.zip
Resolve review comments
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/libpod/options.go b/libpod/options.go
index a36309ed7..3ca80e96c 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -997,7 +997,7 @@ func WithDNSSearch(searchDomains []string) CtrCreateOption {
if ctr.valid {
return ErrCtrFinalized
}
- if ctr.config.NoCreateResolvConf {
+ if ctr.config.UseImageResolvConf {
return errors.Wrapf(ErrInvalidArg, "cannot add DNS search domains if container will not create /etc/resolv.conf")
}
ctr.config.DNSSearch = searchDomains
@@ -1011,7 +1011,7 @@ func WithDNS(dnsServers []string) CtrCreateOption {
if ctr.valid {
return ErrCtrFinalized
}
- if ctr.config.NoCreateResolvConf {
+ if ctr.config.UseImageResolvConf {
return errors.Wrapf(ErrInvalidArg, "cannot add DNS servers if container will not create /etc/resolv.conf")
}
var dns []net.IP
@@ -1033,7 +1033,7 @@ func WithDNSOption(dnsOptions []string) CtrCreateOption {
if ctr.valid {
return ErrCtrFinalized
}
- if ctr.config.NoCreateResolvConf {
+ if ctr.config.UseImageResolvConf {
return errors.Wrapf(ErrInvalidArg, "cannot add DNS options if container will not create /etc/resolv.conf")
}
ctr.config.DNSOption = dnsOptions
@@ -1048,7 +1048,7 @@ func WithHosts(hosts []string) CtrCreateOption {
return ErrCtrFinalized
}
- if ctr.config.NoCreateHosts {
+ if ctr.config.UseImageHosts {
return errors.Wrapf(ErrInvalidArg, "cannot add hosts if container will not create /etc/hosts")
}
@@ -1198,9 +1198,9 @@ func WithCtrNamespace(ns string) CtrCreateOption {
}
}
-// WithNoCreateResolvConf tells the container not to bind-mount resolv.conf in.
+// WithUseImageResolvConf tells the container not to bind-mount resolv.conf in.
// This conflicts with other DNS-related options.
-func WithNoCreateResolvConf() CtrCreateOption {
+func WithUseImageResolvConf() CtrCreateOption {
return func(ctr *Container) error {
if ctr.valid {
return ErrCtrFinalized
@@ -1212,15 +1212,15 @@ func WithNoCreateResolvConf() CtrCreateOption {
return errors.Wrapf(ErrInvalidArg, "not creating resolv.conf conflicts with DNS options")
}
- ctr.config.NoCreateResolvConf = true
+ ctr.config.UseImageResolvConf = true
return nil
}
}
-// WithNoCreateHosts tells the container not to bind-mount /etc/hosts in.
+// WithUseImageHosts tells the container not to bind-mount /etc/hosts in.
// This conflicts with WithHosts().
-func WithNoCreateHosts() CtrCreateOption {
+func WithUseImageHosts() CtrCreateOption {
return func(ctr *Container) error {
if ctr.valid {
return ErrCtrFinalized
@@ -1230,7 +1230,7 @@ func WithNoCreateHosts() CtrCreateOption {
return errors.Wrapf(ErrInvalidArg, "not creating /etc/hosts conflicts with adding to the hosts file")
}
- ctr.config.NoCreateHosts = true
+ ctr.config.UseImageHosts = true
return nil
}