diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-06-17 18:36:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-17 18:36:04 +0200 |
commit | f293606480669acea375c53de1e2c81044313c05 (patch) | |
tree | fde73a8f497f4c161592b092c63bd73b48a68439 /pkg/hooks/read.go | |
parent | 1acd2adccb357c317add19cea8f0daea328e8315 (diff) | |
parent | a36bc1526652341126a180a304d99777378375ff (diff) | |
download | podman-f293606480669acea375c53de1e2c81044313c05.tar.gz podman-f293606480669acea375c53de1e2c81044313c05.tar.bz2 podman-f293606480669acea375c53de1e2c81044313c05.zip |
Merge pull request #6631 from rhatdan/hooks
Fix handling of old oci hooks
Diffstat (limited to 'pkg/hooks/read.go')
-rw-r--r-- | pkg/hooks/read.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/hooks/read.go b/pkg/hooks/read.go index 560ff1899..e20ae9bee 100644 --- a/pkg/hooks/read.go +++ b/pkg/hooks/read.go @@ -3,12 +3,12 @@ package hooks import ( "encoding/json" - "fmt" "io/ioutil" "os" "path/filepath" "strings" + old "github.com/containers/libpod/pkg/hooks/0.1.0" current "github.com/containers/libpod/pkg/hooks/1.0.0" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -49,7 +49,7 @@ func read(content []byte) (hook *current.Hook, err error) { } reader, ok := Readers[ver.Version] if !ok { - return nil, fmt.Errorf("unrecognized hook version: %q", ver.Version) + return nil, errors.Errorf("unrecognized hook version: %q", ver.Version) } hook, err = reader(content) @@ -95,4 +95,6 @@ func ReadDir(path string, extensionStages []string, hooks map[string]*current.Ho func init() { Readers[current.Version] = current.Read + Readers[old.Version] = old.Read + Readers[""] = old.Read } |