Skip to content

Commit

Permalink
catch runc v2 error
Browse files Browse the repository at this point in the history
when runc returns an error about not being v2 complient, catch the error
and logrus an actionable message for users.

Signed-off-by: baude <[email protected]>
  • Loading branch information
baude committed Oct 9, 2019
1 parent c3c40f9 commit c35d71e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libpod/container_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,9 @@ func (c *Container) init(ctx context.Context, retainRetries bool) error {

// With the spec complete, do an OCI create
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
}

Expand Down

0 comments on commit c35d71e

Please sign in to comment.