diff options
author | cdoern <cdoern@redhat.com> | 2021-09-01 10:59:23 -0400 |
---|---|---|
committer | cdoern <cdoern@redhat.com> | 2021-10-01 14:09:11 -0400 |
commit | 6da97c86314d8c80b912ba83db57fd26da19bfb7 (patch) | |
tree | 0e8e3de1d5eb89465b965458fb3068f59c702f34 /libpod/pod.go | |
parent | e9d8524af5122314e47385299bf9ae3d0b000096 (diff) | |
download | podman-6da97c86314d8c80b912ba83db57fd26da19bfb7.tar.gz podman-6da97c86314d8c80b912ba83db57fd26da19bfb7.tar.bz2 podman-6da97c86314d8c80b912ba83db57fd26da19bfb7.zip |
Pod Volumes From Support
added support for a volumes from container. this flag just required movement of the volumes-from flag declaration
out of the !IsInfra block, and minor modificaions to container_create.go
Signed-off-by: cdoern <cdoern@redhat.com>
Diffstat (limited to 'libpod/pod.go')
-rw-r--r-- | libpod/pod.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libpod/pod.go b/libpod/pod.go index c0b0a974b..068a835f6 100644 --- a/libpod/pod.go +++ b/libpod/pod.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "sort" + "strings" "time" "github.com/containers/podman/v3/libpod/define" @@ -200,6 +201,21 @@ func (p *Pod) UserNSMode() string { return "" } +// CPUQuota returns the pod CPU quota +func (p *Pod) VolumesFrom() []string { + if p.state.InfraContainerID == "" { + return nil + } + infra, err := p.runtime.GetContainer(p.state.InfraContainerID) + if err != nil { + return nil + } + if ctrs, ok := infra.config.Spec.Annotations[define.InspectAnnotationVolumesFrom]; ok { + return strings.Split(ctrs, ",") + } + return nil +} + // Labels returns the pod's labels func (p *Pod) Labels() map[string]string { labels := make(map[string]string) |