diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-18 20:44:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-18 20:44:11 +0200 |
commit | c3c902f8316190cf35617f3991c06c6d78f3aff7 (patch) | |
tree | a0dffaf6b1eb0354c3f650e309ad62aa3096e0ab /pkg | |
parent | c1fef2af3ec84b2d9cb27bf3cad9f8414552a3a9 (diff) | |
parent | 02e0d4ab38c239c8d22445dd360d3d177b78e73d (diff) | |
download | podman-c3c902f8316190cf35617f3991c06c6d78f3aff7.tar.gz podman-c3c902f8316190cf35617f3991c06c6d78f3aff7.tar.bz2 podman-c3c902f8316190cf35617f3991c06c6d78f3aff7.zip |
Merge pull request #7352 from Luap99/uts-pod
fix podman create/run UTS NS docs
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/specgen/container_validate.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/specgen/container_validate.go b/pkg/specgen/container_validate.go index 8289e2089..76961fa80 100644 --- a/pkg/specgen/container_validate.go +++ b/pkg/specgen/container_validate.go @@ -46,6 +46,9 @@ func (s *SpecGenerator) Validate() error { } // Cannot set hostname and utsns if len(s.ContainerBasicConfig.Hostname) > 0 && !s.ContainerBasicConfig.UtsNS.IsPrivate() { + if s.ContainerBasicConfig.UtsNS.IsPod() { + return errors.Wrap(ErrInvalidSpecConfig, "cannot set hostname when joining the pod UTS namespace") + } return errors.Wrap(ErrInvalidSpecConfig, "cannot set hostname when running in the host UTS namespace") } // systemd values must be true, false, or always |