summaryrefslogtreecommitdiff
path: root/pkg/hooks/hooks.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-09-22 16:07:39 +0000
committerGitHub <noreply@github.com>2020-09-22 16:07:39 +0000
commit23cb2009196cdf604ad9f0a77ff7544d7a25b5e0 (patch)
treee722f92ab91525237d7114b30f515f883aff765c /pkg/hooks/hooks.go
parent34b87961afb34f53fbdcce1db47bbe9399dd3a2f (diff)
parentfed1ecf470f85d68527498b029252d26c43f50ef (diff)
downloadpodman-23cb2009196cdf604ad9f0a77ff7544d7a25b5e0.tar.gz
podman-23cb2009196cdf604ad9f0a77ff7544d7a25b5e0.tar.bz2
podman-23cb2009196cdf604ad9f0a77ff7544d7a25b5e0.zip
Merge pull request #7724 from vrothberg/hooks
pkg/hooks: support all hooks
Diffstat (limited to 'pkg/hooks/hooks.go')
-rw-r--r--pkg/hooks/hooks.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/hooks/hooks.go b/pkg/hooks/hooks.go
index 2a12eceac..6257529ab 100644
--- a/pkg/hooks/hooks.go
+++ b/pkg/hooks/hooks.go
@@ -120,12 +120,18 @@ func (m *Manager) Hooks(config *rspec.Spec, annotations map[string]string, hasBi
extensionStageHooks[stage] = append(extensionStageHooks[stage], namedHook.hook.Hook)
} else {
switch stage {
+ case "createContainer":
+ config.Hooks.CreateContainer = append(config.Hooks.CreateContainer, namedHook.hook.Hook)
+ case "createRuntime":
+ config.Hooks.CreateRuntime = append(config.Hooks.CreateRuntime, namedHook.hook.Hook)
case "prestart":
config.Hooks.Prestart = append(config.Hooks.Prestart, namedHook.hook.Hook)
case "poststart":
config.Hooks.Poststart = append(config.Hooks.Poststart, namedHook.hook.Hook)
case "poststop":
config.Hooks.Poststop = append(config.Hooks.Poststop, namedHook.hook.Hook)
+ case "startContainer":
+ config.Hooks.StartContainer = append(config.Hooks.StartContainer, namedHook.hook.Hook)
default:
return extensionStageHooks, fmt.Errorf("hook %q: unknown stage %q", namedHook.name, stage)
}