summaryrefslogtreecommitdiff
path: root/libpod/container.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-06-25 10:35:15 -0400
committerMatthew Heon <matthew.heon@gmail.com>2018-07-24 16:12:31 -0400
commit24457873366bbd23d71b364a63037f34c652c04a (patch)
tree407f9b00b003c4baf0e577008a803a5d06c5dd03 /libpod/container.go
parent6715bffaf6a858df9539d6e48e2c1b634364f83e (diff)
downloadpodman-24457873366bbd23d71b364a63037f34c652c04a.tar.gz
podman-24457873366bbd23d71b364a63037f34c652c04a.tar.bz2
podman-24457873366bbd23d71b364a63037f34c652c04a.zip
Add container and pod namespaces to configs
Libpod namespaces are a way to logically separate groups of pods and containers within the state. Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Diffstat (limited to 'libpod/container.go')
-rw-r--r--libpod/container.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/libpod/container.go b/libpod/container.go
index b4a1eeb12..456fc412d 100644
--- a/libpod/container.go
+++ b/libpod/container.go
@@ -185,6 +185,8 @@ type ContainerConfig struct {
Name string `json:"name"`
// Full ID of the pood the container belongs to
Pod string `json:"pod,omitempty"`
+ // Namespace the container is in
+ Namespace string `json:"namespace,omitempty"`
// TODO consider breaking these subsections up into smaller structs
@@ -372,6 +374,12 @@ func (c *Container) PodID() string {
return c.config.Pod
}
+// Namespace returns the libpod namespace the container is in.
+// Namespaces are used to logically separate containers and pods in the state.
+func (c *Container) Namespace() string {
+ return c.config.Namespace
+}
+
// Image returns the ID and name of the image used as the container's rootfs
func (c *Container) Image() (string, string) {
return c.config.RootfsImageID, c.config.RootfsImageName