aboutsummaryrefslogtreecommitdiff
path: root/pkg/specgen/pod_validate.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-07-15 16:38:36 -0400
committerGitHub <noreply@github.com>2020-07-15 16:38:36 -0400
commit6dcff5c32b4ed68378c6df7c6b0fd04a902dc405 (patch)
tree1b20819b46e2fee91f76ad6a017b91d6bea529b6 /pkg/specgen/pod_validate.go
parent9051546c4df40b611ca09b02ae57ae6e8fb72c94 (diff)
parentc58127602e57ad489bd951760026dccd7593eeaf (diff)
downloadpodman-6dcff5c32b4ed68378c6df7c6b0fd04a902dc405.tar.gz
podman-6dcff5c32b4ed68378c6df7c6b0fd04a902dc405.tar.bz2
podman-6dcff5c32b4ed68378c6df7c6b0fd04a902dc405.zip
Merge pull request #6975 from baude/rootlessIPMAC
Error on rootless mac and ip addresses
Diffstat (limited to 'pkg/specgen/pod_validate.go')
-rw-r--r--pkg/specgen/pod_validate.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/specgen/pod_validate.go b/pkg/specgen/pod_validate.go
index 070bb1e41..69c3b58ed 100644
--- a/pkg/specgen/pod_validate.go
+++ b/pkg/specgen/pod_validate.go
@@ -1,6 +1,7 @@
package specgen
import (
+ "github.com/containers/libpod/v2/pkg/rootless"
"github.com/containers/libpod/v2/pkg/util"
"github.com/pkg/errors"
)
@@ -18,6 +19,16 @@ func exclusivePodOptions(opt1, opt2 string) error {
// Validate verifies the input is valid
func (p *PodSpecGenerator) Validate() error {
+
+ if rootless.IsRootless() {
+ if p.StaticIP != nil {
+ return ErrNoStaticIPRootless
+ }
+ if p.StaticMAC != nil {
+ return ErrNoStaticMACRootless
+ }
+ }
+
// PodBasicConfig
if p.NoInfra {
if len(p.InfraCommand) > 0 {