Fix errors where OCI hooks directory does not exist

Signed-off-by: Matthew Heon <mheon@redhat.com>
This commit is contained in:
Matthew Heon
2018-12-07 11:23:03 -05:00
parent 71497706e1
commit 176f76d794

View File

@ -1228,6 +1228,10 @@ func (c *Container) setupOCIHooks(ctx context.Context, config *spec.Spec) (exten
manager, err := hooks.New(ctx, c.runtime.config.HooksDir, []string{"poststop"}, lang)
if err != nil {
if os.IsNotExist(err) {
logrus.Warnf("Requested OCI hooks directory %q does not exist", c.runtime.config.HooksDir)
return nil, nil
}
return nil, err
}