summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-01-28 04:58:28 -0500
committerGitHub <noreply@github.com>2021-01-28 04:58:28 -0500
commitfb653c43ed1eb9eb9b97ca80edb8df6caab88905 (patch)
tree54e861b691d68f3f2c6b32ad00d57455dc2b9a39 /pkg
parent9d59daa7ccaea526a1aa742fadab537e77a51330 (diff)
parent1fac43654cf2ec950a2b3221e27425dbcd3bbf4d (diff)
downloadpodman-fb653c43ed1eb9eb9b97ca80edb8df6caab88905.tar.gz
podman-fb653c43ed1eb9eb9b97ca80edb8df6caab88905.tar.bz2
podman-fb653c43ed1eb9eb9b97ca80edb8df6caab88905.zip
Merge pull request #8585 from Luap99/rootless-net-alias
Add support for rootless network-aliases and static ip/mac
Diffstat (limited to 'pkg')
-rw-r--r--pkg/specgen/container_validate.go2
-rw-r--r--pkg/specgen/pod_validate.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/pkg/specgen/container_validate.go b/pkg/specgen/container_validate.go
index a0d36f865..81cb8b78d 100644
--- a/pkg/specgen/container_validate.go
+++ b/pkg/specgen/container_validate.go
@@ -30,7 +30,7 @@ func exclusiveOptions(opt1, opt2 string) error {
// input for creating a container.
func (s *SpecGenerator) Validate() error {
- if rootless.IsRootless() {
+ if rootless.IsRootless() && len(s.CNINetworks) == 0 {
if s.StaticIP != nil || s.StaticIPv6 != nil {
return ErrNoStaticIPRootless
}
diff --git a/pkg/specgen/pod_validate.go b/pkg/specgen/pod_validate.go
index 7c81f3f9f..518adb32f 100644
--- a/pkg/specgen/pod_validate.go
+++ b/pkg/specgen/pod_validate.go
@@ -20,7 +20,7 @@ func exclusivePodOptions(opt1, opt2 string) error {
// Validate verifies the input is valid
func (p *PodSpecGenerator) Validate() error {
- if rootless.IsRootless() {
+ if rootless.IsRootless() && len(p.CNINetworks) == 0 {
if p.StaticIP != nil {
return ErrNoStaticIPRootless
}