diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-03-07 14:16:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-07 14:16:43 +0100 |
commit | c8de26fb0835bb3572af250088d4f66a3162ccd0 (patch) | |
tree | 9fa5f0d4b6f2591b5809dd23d0349d984f630db7 /pkg/specgen/namespaces.go | |
parent | 43bf4f6626cc25ab839d989c025771de4669f86b (diff) | |
parent | 8b5e2a6297e6f6a5426551d1648278906a9d23de (diff) | |
download | podman-c8de26fb0835bb3572af250088d4f66a3162ccd0.tar.gz podman-c8de26fb0835bb3572af250088d4f66a3162ccd0.tar.bz2 podman-c8de26fb0835bb3572af250088d4f66a3162ccd0.zip |
Merge pull request #5374 from baude/create
add default network for apiv2 create
Diffstat (limited to 'pkg/specgen/namespaces.go')
-rw-r--r-- | pkg/specgen/namespaces.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/pkg/specgen/namespaces.go b/pkg/specgen/namespaces.go index 79a83819a..fa2dee77d 100644 --- a/pkg/specgen/namespaces.go +++ b/pkg/specgen/namespaces.go @@ -70,9 +70,7 @@ func (n *Namespace) IsPrivate() bool { return n.NSMode == Private } -// validate perform simple validation on the namespace to make sure it is not -// invalid from the get-go -func (n *Namespace) validate() error { +func validateNetNS(n *Namespace) error { if n == nil { return nil } @@ -82,6 +80,15 @@ func (n *Namespace) validate() error { default: return errors.Errorf("invalid network %q", n.NSMode) } + return nil +} + +// validate perform simple validation on the namespace to make sure it is not +// invalid from the get-go +func (n *Namespace) validate() error { + if n == nil { + return nil + } // Path and From Container MUST have a string value set if n.NSMode == Path || n.NSMode == FromContainer { if len(n.Value) < 1 { |