Skip to content

Commit

Permalink
validation: add hostname validation
Browse files Browse the repository at this point in the history
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
  • Loading branch information
Ma Shimiao committed May 19, 2016
1 parent 037ba51 commit 82ba2b0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ func checkLinux(spec rspec.Linux, rootfs string) {
for index := 0; index < len(spec.Namespaces); index++ {
if !namespaceValid(spec.Namespaces[index]) {
logrus.Fatalf("Namespace %s is invalid.", spec.Namespaces[index])
} else if spec.Namespaces[index].Type == rspec.UTSNamespace && rspec.Spec.Hostname != "" {
logrus.Fatalf("New UTS namespace should to be created.")
}
}

Expand Down

0 comments on commit 82ba2b0

Please sign in to comment.