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