summaryrefslogtreecommitdiff
path: root/pkg/specgen/namespaces.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/specgen/namespaces.go')
-rw-r--r--pkg/specgen/namespaces.go13
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 {