Skip to content

Commit

Permalink
*: validate rootfs default and verification
Browse files Browse the repository at this point in the history
First of all, it doesn't make sense for us to not include a rootfs in
our default configuration -- as it means that we're providing an
invalid configuration.

Second of all, the test to check whether the path is "rootfs" is
completely meaningless. containerd and Docker would fail that test,
simply because it's pointlessly restrictive. No aspect of the
runtime-spec states that it is a spec violation to *not* use "rootfs",
so why would we punish people for it?

Fix both of these bugs.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
  • Loading branch information
cyphar committed Oct 2, 2017
1 parent 7f63063 commit 5d22fd0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func New() Generator {
spec := rspec.Spec{
Version: rspec.Version,
Root: &rspec.Root{
Path: "",
Path: "rootfs",
Readonly: false,
},
Process: &rspec.Process{
Expand Down
5 changes: 0 additions & 5 deletions validate/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,6 @@ func (v *Validator) CheckRoot() (errs error) {
return
}

if filepath.Base(v.spec.Root.Path) != "rootfs" {
errs = multierror.Append(errs,
specerror.NewError(specerror.PathName, fmt.Errorf("path name should be the conventional 'rootfs'"), rspec.Version))
}

var rootfsPath string
var absRootPath string
if filepath.IsAbs(v.spec.Root.Path) {
Expand Down

0 comments on commit 5d22fd0

Please sign in to comment.