mirror of
https://github.com/containers/podman.git
synced 2025-10-17 19:24:04 +08:00
libpod: refactor platformMakePod signature
accept only the resources to be used by the pod, so that the function can more easily be used by a successive patch. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -58,9 +58,13 @@ func (r *Runtime) NewPod(ctx context.Context, p specgen.PodSpecGenerator, option
|
||||
|
||||
pod.valid = true
|
||||
|
||||
if err := r.platformMakePod(pod, p); err != nil {
|
||||
parentCgroup, err := r.platformMakePod(pod, p.ResourceLimits)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if p.InfraContainerSpec != nil {
|
||||
p.InfraContainerSpec.CgroupParent = parentCgroup
|
||||
}
|
||||
|
||||
if !pod.HasInfraContainer() && pod.SharesNamespaces() {
|
||||
return nil, errors.New("Pods must have an infra container to share namespaces")
|
||||
|
Reference in New Issue
Block a user