mirror of
https://github.com/containers/podman.git
synced 2025-05-22 01:27:07 +08:00
Add --namespace flag to Podman
Allows joining libpod to a specific namespace when running a Podman command. Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
This commit is contained in:
@ -88,6 +88,10 @@ func GetRuntimeWithStorageOpts(c *cli.Context, storageOpts *storage.StoreOptions
|
|||||||
// TODO CLI flags for image config?
|
// TODO CLI flags for image config?
|
||||||
// TODO CLI flag for signature policy?
|
// TODO CLI flag for signature policy?
|
||||||
|
|
||||||
|
if c.GlobalIsSet("namespace") {
|
||||||
|
options = append(options, libpod.WithNamespace(c.GlobalString("namespace")))
|
||||||
|
}
|
||||||
|
|
||||||
if c.GlobalIsSet("runtime") {
|
if c.GlobalIsSet("runtime") {
|
||||||
options = append(options, libpod.WithOCIRuntime(c.GlobalString("runtime")))
|
options = append(options, libpod.WithOCIRuntime(c.GlobalString("runtime")))
|
||||||
}
|
}
|
||||||
|
@ -172,6 +172,11 @@ func main() {
|
|||||||
Usage: "log messages above specified level: debug, info, warn, error (default), fatal or panic",
|
Usage: "log messages above specified level: debug, info, warn, error (default), fatal or panic",
|
||||||
Value: "error",
|
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{
|
cli.StringFlag{
|
||||||
Name: "root",
|
Name: "root",
|
||||||
Usage: "path to the root directory in which data, including images, is stored",
|
Usage: "path to the root directory in which data, including images, is stored",
|
||||||
|
@ -2224,6 +2224,7 @@ _podman_podman() {
|
|||||||
--storage-driver
|
--storage-driver
|
||||||
--storage-opt
|
--storage-opt
|
||||||
--log-level
|
--log-level
|
||||||
|
--namespace
|
||||||
"
|
"
|
||||||
local boolean_options="
|
local boolean_options="
|
||||||
--help -h
|
--help -h
|
||||||
|
@ -39,6 +39,11 @@ Path to where the cpu performance results should be written
|
|||||||
|
|
||||||
log messages above specified level: debug, info, warn, error (default), fatal or panic
|
log messages above specified level: debug, info, warn, error (default), fatal or panic
|
||||||
|
|
||||||
|
**--namespace**
|
||||||
|
|
||||||
|
set namespace libpod namespace. Namespaces are used to separate groups of containers and pods in libpod's state.
|
||||||
|
When namespace is set, created containers and pods will join the given namespace, and only containers and pods in the given namespace will be visible to Podman.
|
||||||
|
|
||||||
**--root**=**value**
|
**--root**=**value**
|
||||||
|
|
||||||
Path to the root directory in which data, including images, is stored
|
Path to the root directory in which data, including images, is stored
|
||||||
|
@ -285,7 +285,6 @@ func WithCNIPluginDir(dir string) RuntimeOption {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// WithNamespace sets the namespace for libpod.
|
// WithNamespace sets the namespace for libpod.
|
||||||
// Namespace is the libpod namespace to use.
|
|
||||||
// Namespaces are used to create scopes to separate containers and pods
|
// Namespaces are used to create scopes to separate containers and pods
|
||||||
// in the state.
|
// in the state.
|
||||||
// When namespace is set, libpod will only view containers and pods in
|
// When namespace is set, libpod will only view containers and pods in
|
||||||
|
Reference in New Issue
Block a user