diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-04-22 08:50:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-22 08:50:32 -0400 |
commit | ad3da638ce17439a7adbf2aa7e1b4017d583f660 (patch) | |
tree | 4a975c6d37e9a3dad98b8e2f3119f58650589d5c /pkg/specgen | |
parent | 1bafde2d226067257d430c367ec2c53208d3eeeb (diff) | |
parent | e0f5bf279bd6aba1b018c2a2d7d31ee5a5f7b70b (diff) | |
download | podman-ad3da638ce17439a7adbf2aa7e1b4017d583f660.tar.gz podman-ad3da638ce17439a7adbf2aa7e1b4017d583f660.tar.bz2 podman-ad3da638ce17439a7adbf2aa7e1b4017d583f660.zip |
Merge pull request #13918 from Luap99/hosts
use etchosts package from c/common
Diffstat (limited to 'pkg/specgen')
-rw-r--r-- | pkg/specgen/container_validate.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/specgen/container_validate.go b/pkg/specgen/container_validate.go index 42b70e334..e06cd9a29 100644 --- a/pkg/specgen/container_validate.go +++ b/pkg/specgen/container_validate.go @@ -38,6 +38,13 @@ func (s *SpecGenerator) Validate() error { if len(s.PortMappings) > 0 || s.PublishExposedPorts { return errors.Wrap(define.ErrNetworkOnPodContainer, "published or exposed ports must be defined when the pod is created") } + if len(s.HostAdd) > 0 { + return errors.Wrap(define.ErrNetworkOnPodContainer, "extra host entries must be specified on the pod") + } + } + + if s.NetNS.IsContainer() && len(s.HostAdd) > 0 { + return errors.Wrap(ErrInvalidSpecConfig, "cannot set extra host entries when the container is joined to another containers network namespace") } // |