From 0cd92eae65b31cdbaa19e3cccb0e3234196a6d17 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Tue, 26 Mar 2019 13:55:19 -0400 Subject: Resolve review comments Signed-off-by: Matthew Heon --- libpod/options.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'libpod/options.go') 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 } -- cgit v1.2.3-54-g00ecf