summaryrefslogtreecommitdiff
path: root/pkg/specgen/container_validate.go
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2020-08-18 12:19:28 +0200
committerPaul Holzinger <paul.holzinger@web.de>2020-08-18 18:00:49 +0200
commit02e0d4ab38c239c8d22445dd360d3d177b78e73d (patch)
tree63a13df505cfbf77b2ecd9e2db0bd24a584f98c7 /pkg/specgen/container_validate.go
parent748e8829da76394ec956ea6590599fab01b467b7 (diff)
downloadpodman-02e0d4ab38c239c8d22445dd360d3d177b78e73d.tar.gz
podman-02e0d4ab38c239c8d22445dd360d3d177b78e73d.tar.bz2
podman-02e0d4ab38c239c8d22445dd360d3d177b78e73d.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/specgen/container_validate.go')
-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 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