catch runc v2 error

when runc returns an error about not being v2 complient, catch the error
and logrus an actionable message for users.

Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
baude 2019-10-07 19:11:42 -05:00
parent c3c40f970e
commit c35d71e3da
1 changed files with 3 additions and 0 deletions

View File

@ -939,6 +939,9 @@ func (c *Container) init(ctx context.Context, retainRetries bool) error {
// With the spec complete, do an OCI create // With the spec complete, do an OCI create
if err := c.ociRuntime.createContainer(c, nil); err != nil { if err := c.ociRuntime.createContainer(c, nil); err != nil {
if strings.Contains(err.Error(), "this version of runc doesn't work on cgroups v2") {
logrus.Errorf("oci runtime %q does not support CGroups V2: use system migrate to mitigate", c.ociRuntime.name)
}
return err return err
} }