From 3ae0c80806b68f712756fd660d06449e71eb41b7 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Thu, 19 Jul 2018 14:24:22 -0400 Subject: Add --namespace flag to Podman Allows joining libpod to a specific namespace when running a Podman command. Signed-off-by: Matthew Heon --- cmd/podman/libpodruntime/runtime.go | 4 ++++ cmd/podman/main.go | 5 +++++ 2 files changed, 9 insertions(+) (limited to 'cmd') diff --git a/cmd/podman/libpodruntime/runtime.go b/cmd/podman/libpodruntime/runtime.go index 3216d288b..9d1347cc5 100644 --- a/cmd/podman/libpodruntime/runtime.go +++ b/cmd/podman/libpodruntime/runtime.go @@ -88,6 +88,10 @@ func GetRuntimeWithStorageOpts(c *cli.Context, storageOpts *storage.StoreOptions // TODO CLI flags for image config? // TODO CLI flag for signature policy? + if c.GlobalIsSet("namespace") { + options = append(options, libpod.WithNamespace(c.GlobalString("namespace"))) + } + if c.GlobalIsSet("runtime") { options = append(options, libpod.WithOCIRuntime(c.GlobalString("runtime"))) } diff --git a/cmd/podman/main.go b/cmd/podman/main.go index 3dbf196c2..9ae45e056 100644 --- a/cmd/podman/main.go +++ b/cmd/podman/main.go @@ -172,6 +172,11 @@ func main() { Usage: "log messages above specified level: debug, info, warn, error (default), fatal or panic", Value: "error", }, + cli.StringFlag{ + Name: "namespace", + Usage: "set the libpod namespace, used create separate views of the containers and pods on the system", + Value: "", + }, cli.StringFlag{ Name: "root", Usage: "path to the root directory in which data, including images, is stored", -- cgit v1.2.3-54-g00ecf