From 24457873366bbd23d71b364a63037f34c652c04a Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Mon, 25 Jun 2018 10:35:15 -0400 Subject: 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 --- libpod/pod.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libpod/pod.go') 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) -- cgit v1.2.3-54-g00ecf