Merge pull request #1826 from jingxiaolu/fix_specconv_process_nil

specconv: fix null spec.Process making runc panic
This commit is contained in:
Mrunal Patel 2020-03-23 21:07:06 -07:00 committed by GitHub
commit 3087d43bc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -585,3 +585,16 @@ func TestInitSystemdProps(t *testing.T) {
}
}
}
func TestNullProcess(t *testing.T) {
spec := Example()
spec.Process = nil
_, err := CreateLibcontainerConfig(&CreateOpts{
Spec: spec,
})
if err != nil {
t.Errorf("Null process should be forbidden")
}
}