Merge pull request #1955 from mheon/fix_hooks_not_exist

Fix errors where OCI hooks directory does not exist
This commit is contained in:
OpenShift Merge Robot 2018-12-07 10:32:58 -08:00 committed by GitHub
commit d6ce797edb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

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
}