summaryrefslogtreecommitdiff
path: root/pkg/hooks/read.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-07-26 10:25:05 +0200
committerGitHub <noreply@github.com>2019-07-26 10:25:05 +0200
commit4674d00f46380f38532ebf32cd632579b47773bb (patch)
tree25c7482dff6fc8fe6502073c8a9c045a525c8dfe /pkg/hooks/read.go
parentdff82d940e50c50c9f15a0371942662ccaaaae43 (diff)
parentd6ea4b4139c5e890acdb99cbcc303c160031a780 (diff)
downloadpodman-4674d00f46380f38532ebf32cd632579b47773bb.tar.gz
podman-4674d00f46380f38532ebf32cd632579b47773bb.tar.bz2
podman-4674d00f46380f38532ebf32cd632579b47773bb.zip
Merge pull request #3580 from samc24/hook
Improved hooks monitoring
Diffstat (limited to 'pkg/hooks/read.go')
-rw-r--r--pkg/hooks/read.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkg/hooks/read.go b/pkg/hooks/read.go
index d3995a0be..560ff1899 100644
--- a/pkg/hooks/read.go
+++ b/pkg/hooks/read.go
@@ -67,7 +67,7 @@ func ReadDir(path string, extensionStages []string, hooks map[string]*current.Ho
if err != nil {
return err
}
-
+ res := err
for _, file := range files {
filePath := filepath.Join(path, file.Name())
hook, err := Read(filePath, extensionStages)
@@ -80,12 +80,17 @@ func ReadDir(path string, extensionStages []string, hooks map[string]*current.Ho
continue
}
}
- return err
+ if res == nil {
+ res = err
+ } else {
+ res = errors.Wrapf(res, "%v", err)
+ }
+ continue
}
hooks[file.Name()] = hook
logrus.Debugf("added hook %s", filePath)
}
- return nil
+ return res
}
func init() {