summaryrefslogtreecommitdiff
path: root/pkg/hooks/0.1.0/hook.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-06-17 18:36:04 +0200
committerGitHub <noreply@github.com>2020-06-17 18:36:04 +0200
commitf293606480669acea375c53de1e2c81044313c05 (patch)
treefde73a8f497f4c161592b092c63bd73b48a68439 /pkg/hooks/0.1.0/hook.go
parent1acd2adccb357c317add19cea8f0daea328e8315 (diff)
parenta36bc1526652341126a180a304d99777378375ff (diff)
downloadpodman-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/0.1.0/hook.go')
-rw-r--r--pkg/hooks/0.1.0/hook.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/pkg/hooks/0.1.0/hook.go b/pkg/hooks/0.1.0/hook.go
index 88a387647..185cc90d1 100644
--- a/pkg/hooks/0.1.0/hook.go
+++ b/pkg/hooks/0.1.0/hook.go
@@ -6,7 +6,6 @@ import (
"errors"
"strings"
- "github.com/containers/libpod/pkg/hooks"
current "github.com/containers/libpod/pkg/hooks/1.0.0"
rspec "github.com/opencontainers/runtime-spec/specs-go"
)
@@ -32,8 +31,9 @@ type Hook struct {
HasBindMounts *bool `json:"hasbindmounts,omitempty"`
}
-func read(content []byte) (hook *current.Hook, err error) {
+func Read(content []byte) (hook *current.Hook, err error) {
var raw Hook
+
if err = json.Unmarshal(content, &raw); err != nil {
return nil, err
}
@@ -86,8 +86,3 @@ func read(content []byte) (hook *current.Hook, err error) {
return hook, nil
}
-
-func init() {
- hooks.Readers[""] = read
- hooks.Readers[Version] = read
-}