summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2020-08-18 12:19:28 +0200
committerMatthew Heon <matthew.heon@pm.me>2020-08-20 12:25:55 -0400
commit0ef668878572986951df57fb38596683e5750d07 (patch)
treeae23b31bcf0fdf615fd51b969ea59d4966f5e88c /pkg
parentce1389bde7c62ef4eaf9ed8b2f0a68a4c14bbb9d (diff)
downloadpodman-0ef668878572986951df57fb38596683e5750d07.tar.gz
podman-0ef668878572986951df57fb38596683e5750d07.tar.bz2
podman-0ef668878572986951df57fb38596683e5750d07.zip
fix podman create/run UTS NS docs
Add better error message when using `--pod` and `--hostname`. Improve the docs to better explain the uts hostname relation. Add more valid options for the `--uts` flag. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/specgen/container_validate.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/specgen/container_validate.go b/pkg/specgen/container_validate.go
index a979a7f4a..4dd2ab0b3 100644
--- a/pkg/specgen/container_validate.go
+++ b/pkg/specgen/container_validate.go
@@ -43,6 +43,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