diff options
author | Brent Baude <bbaude@redhat.com> | 2020-08-20 09:52:53 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-08-21 09:21:15 -0500 |
commit | 7b21bcef5881db4f341090d255f6ef204a30dd1e (patch) | |
tree | a09d34eeb47a8a4c0df4b2d6105f8ebe34c3b9b6 /libpod | |
parent | 7ccd821397d03ed545635de2a0b70a68ab4d46db (diff) | |
download | podman-7b21bcef5881db4f341090d255f6ef204a30dd1e.tar.gz podman-7b21bcef5881db4f341090d255f6ef204a30dd1e.tar.bz2 podman-7b21bcef5881db4f341090d255f6ef204a30dd1e.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>
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 6e372eb5e..f80b1d6e3 100644 --- a/libpod/define/errors.go +++ b/libpod/define/errors.go @@ -157,4 +157,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") ) |