From fdcf633a33bbbfbc99268965ef5da03a4770619b Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Thu, 29 Mar 2018 11:01:47 -0400 Subject: Add hooks support to podman Signed-off-by: Daniel J Walsh Closes: #155 Approved by: mheon --- cmd/podman/main.go | 7 +++++++ cmd/podman/spec.go | 1 - cmd/podman/utils.go | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/podman/main.go b/cmd/podman/main.go index 2a0ca30ee..ef11f7905 100644 --- a/cmd/podman/main.go +++ b/cmd/podman/main.go @@ -7,6 +7,7 @@ import ( "github.com/containers/storage/pkg/reexec" "github.com/pkg/errors" + "github.com/projectatomic/libpod/pkg/hooks" "github.com/projectatomic/libpod/version" "github.com/sirupsen/logrus" "github.com/urfave/cli" @@ -122,6 +123,12 @@ func main() { Name: "cpu-profile", Usage: "path for the cpu profiling results", }, + cli.StringFlag{ + Name: "hooks-dir-path", + Usage: "set the OCI hooks directory path", + Value: hooks.DefaultHooksDir, + Hidden: true, + }, cli.StringFlag{ Name: "log-level", Usage: "log messages above specified level: debug, info, warn, error (default), fatal or panic", diff --git a/cmd/podman/spec.go b/cmd/podman/spec.go index 014919e17..5e98d5b50 100644 --- a/cmd/podman/spec.go +++ b/cmd/podman/spec.go @@ -378,7 +378,6 @@ func createConfigToOCISpec(config *createConfig) (*spec.Spec, error) { } /* - Hooks: &configSpec.Hooks{}, //Annotations Resources: &configSpec.LinuxResources{ BlockIO: &blkio, diff --git a/cmd/podman/utils.go b/cmd/podman/utils.go index 4c42c8ff5..8b59e1344 100644 --- a/cmd/podman/utils.go +++ b/cmd/podman/utils.go @@ -48,6 +48,7 @@ func getRuntime(c *cli.Context) (*libpod.Runtime, error) { if c.GlobalIsSet("cni-config-dir") { options = append(options, libpod.WithCNIConfigDir(c.GlobalString("cni-config-dir"))) } + options = append(options, libpod.WithHooksDir(c.GlobalString("hooks-dir-path"))) // TODO flag to set CNI plugins dir? -- cgit v1.2.3-54-g00ecf