From 45838b9561977f3e79cf2e61c7ed0dfd9badb303 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 11 May 2018 13:03:28 -0700 Subject: hooks: Add package support for extension stages We aren't consuming this yet, but these pkg/hooks changes lay the groundwork for future libpod changes to support post-exit hooks [1,2]. [1]: https://github.com/projectatomic/libpod/issues/730 [2]: https://github.com/opencontainers/runc/issues/1797 Signed-off-by: W. Trevor King Closes: #758 Approved by: rhatdan --- libpod/container_internal.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libpod') diff --git a/libpod/container_internal.go b/libpod/container_internal.go index b0f39fec8..5168e987b 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -1333,7 +1333,7 @@ func (c *Container) setupOCIHooks(ctx context.Context, g *generate.Generator) er } } - manager, err := hooks.New(ctx, []string{c.runtime.config.HooksDir}, lang) + manager, err := hooks.New(ctx, []string{c.runtime.config.HooksDir}, []string{}, lang) if err != nil { if c.runtime.config.HooksDirNotExistFatal || !os.IsNotExist(err) { return err @@ -1342,5 +1342,6 @@ func (c *Container) setupOCIHooks(ctx context.Context, g *generate.Generator) er return nil } - return manager.Hooks(g.Spec(), c.Spec().Annotations, len(c.config.UserVolumes) > 0) + _, err = manager.Hooks(g.Spec(), c.Spec().Annotations, len(c.config.UserVolumes) > 0) + return err } -- cgit v1.2.3-54-g00ecf