mirror of
https://github.com/containers/podman.git
synced 2025-10-17 19:24:04 +08:00
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>
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user