summaryrefslogtreecommitdiff
path: root/pkg/specgen
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-01-29 11:38:21 -0500
committerGitHub <noreply@github.com>2021-01-29 11:38:21 -0500
commitb6336071101fe4f19a7826d16f0dd61394678853 (patch)
tree8b9d0ff7efd5d995c5621a2ef7862582ae977d99 /pkg/specgen
parent4dbb58d63759ab1019b55bc50816e30361715d8b (diff)
parente42f9ee69766758968f11e5a6a5a189f5142ba78 (diff)
downloadpodman-b6336071101fe4f19a7826d16f0dd61394678853.tar.gz
podman-b6336071101fe4f19a7826d16f0dd61394678853.tar.bz2
podman-b6336071101fe4f19a7826d16f0dd61394678853.zip
Merge pull request #9141 from Luap99/v3-rootless-cni
[v3.0] Add support for rootless network-aliases and static ip/mac
Diffstat (limited to 'pkg/specgen')
-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
}