Create a new Error when there is no Error to wrap

Wrapping a `nil` error produces `nil`, which causes the calling code to
see success, and continue on with a default-created WorkerOpt, which
causes segfaults later.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
v0.7
Paul "TBBle" Hampson 2020-01-06 00:42:14 +11:00
parent 1036fafffa
commit c67499de09
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ func newContainerd(root string, client *containerd.Client, snapshotterName, ns s
return base.WorkerOpt{}, errors.Wrap(err, "failed to list runtime plugin")
}
if len(resp.Plugins) == 0 {
return base.WorkerOpt{}, errors.Wrap(err, "failed to get runtime plugin")
return base.WorkerOpt{}, errors.New("failed to find any runtime plugins")
}
var platforms []specs.Platform