summaryrefslogtreecommitdiff
path: root/libpod/pod.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/pod.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/pod.go')
-rw-r--r--libpod/pod.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/libpod/pod.go b/libpod/pod.go
index fb69787ed..a5b87f8b5 100644
--- a/libpod/pod.go
+++ b/libpod/pod.go
@@ -27,6 +27,8 @@ type Pod struct {
type PodConfig struct {
ID string `json:"id"`
Name string `json:"name"`
+ // Namespace the pod is in
+ Namespace string `json:"namespace,omitempty"`
// Labels contains labels applied to the pod
Labels map[string]string `json:"labels"`
@@ -58,6 +60,12 @@ func (p *Pod) Name() string {
return p.config.Name
}
+// Namespace returns the pod's libpod namespace.
+// Namespaces are used to logically separate containers and pods in the state.
+func (p *Pod) Namespace() string {
+ return p.config.Namespace
+}
+
// Labels returns the pod's labels
func (p *Pod) Labels() map[string]string {
labels := make(map[string]string)