diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-03-25 12:12:18 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-03-27 10:12:18 -0400 |
commit | 236300d02832b1c131e5d70f3510e5169857b69b (patch) | |
tree | 627a606040676ff90771f7dff5a5a426c3015c06 /pkg | |
parent | 16a7c7ff82e53bb29d03d816ffa53ae4ae29e86f (diff) | |
download | podman-236300d02832b1c131e5d70f3510e5169857b69b.tar.gz podman-236300d02832b1c131e5d70f3510e5169857b69b.tar.bz2 podman-236300d02832b1c131e5d70f3510e5169857b69b.zip |
Add --no-hosts flag to disable management of /etc/hosts
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/spec/createconfig.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go index fba69d1ba..15719beab 100644 --- a/pkg/spec/createconfig.go +++ b/pkg/spec/createconfig.go @@ -88,6 +88,7 @@ type CreateConfig struct { ExposedPorts map[nat.Port]struct{} GroupAdd []string // group-add HealthCheck *manifest.Schema2HealthConfig + NoHosts bool HostAdd []string //add-host Hostname string //hostname Image string @@ -514,7 +515,10 @@ func (c *CreateConfig) GetContainerCreateOptions(runtime *libpod.Runtime, pod *l if len(c.DNSOpt) > 0 { options = append(options, libpod.WithDNSOption(c.DNSOpt)) } - if len(c.HostAdd) > 0 { + if c.NoHosts { + options = append(options, libpod.WithNoCreateHosts()) + } + if len(c.HostAdd) > 0 && !c.NoHosts { options = append(options, libpod.WithHosts(c.HostAdd)) } logPath := getLoggingPath(c.LogDriverOpt) |