diff options
author | Brent Baude <bbaude@redhat.com> | 2020-08-20 09:52:53 -0500 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2020-08-24 11:31:37 -0400 |
commit | 23251149aba5965e06bc35ddbd15717b2bb7b43b (patch) | |
tree | 5513812de25908f450fd890226ca0d39574039a1 /libpod | |
parent | c78c6b44ce63430218e141415a10b2010d42f883 (diff) | |
download | podman-23251149aba5965e06bc35ddbd15717b2bb7b43b.tar.gz podman-23251149aba5965e06bc35ddbd15717b2bb7b43b.tar.bz2 podman-23251149aba5965e06bc35ddbd15717b2bb7b43b.zip |
error when adding container to pod with network information
because a pod's network information is dictated by the infra container at creation, a container cannot be created with network attributes. this has been difficult for users to understand. we now return an error when a container is being created inside a pod and passes any of the following attributes:
* static IP (v4 and v6)
* static mac
* ports -p (i.e. -p 8080:80)
* exposed ports (i.e. 222-225)
* publish ports from image -P
Signed-off-by: Brent Baude <bbaude@redhat.com>
<MH: Fixed cherry pick conflicts and compile>
Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/define/errors.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/define/errors.go b/libpod/define/errors.go index 5cadce396..e27626fcc 100644 --- a/libpod/define/errors.go +++ b/libpod/define/errors.go @@ -160,4 +160,8 @@ var ( // ErrImageInUse indicates the requested operation failed because the image was in use ErrImageInUse = errors.New("image is being used") + + // ErrNetworkOnPodContainer indicates the user wishes to alter network attributes on a container + // in a pod. This cannot be done as the infra container has all the network information + ErrNetworkOnPodContainer = errors.New("network cannot be configured when it is shared with a pod") ) |