Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cmd/ocitools/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,13 @@ func checkLinux(spec rspec.Spec, rootfs string, hostCheck bool) (msgs []string)
} else if spec.Linux.Namespaces[index].Type == rspec.MountNamespace {
mountExists = true
}
} else if hostCheck {
_, err := os.Stat(spec.Linux.Namespaces[index].Path)
if os.IsNotExist(err) {
msgs = append(msgs, fmt.Sprintf("Path of %v not exist", spec.Linux.Namespaces[index].Type))
} else if err != nil {
msgs = append(msgs, fmt.Sprintf("%v is invalid: %s", spec.Linux.Namespaces[index].Type, err.Error()))
}
}
}

Expand Down