summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/container.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/specgen/generate/container.go')
-rw-r--r--pkg/specgen/generate/container.go15
1 files changed, 1 insertions, 14 deletions
diff --git a/pkg/specgen/generate/container.go b/pkg/specgen/generate/container.go
index 46b7a2dc2..c4fbda9e5 100644
--- a/pkg/specgen/generate/container.go
+++ b/pkg/specgen/generate/container.go
@@ -18,7 +18,6 @@ import (
envLib "github.com/containers/podman/v4/pkg/env"
"github.com/containers/podman/v4/pkg/signal"
"github.com/containers/podman/v4/pkg/specgen"
- spec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/openshift/imagebuilder"
"github.com/sirupsen/logrus"
)
@@ -272,19 +271,7 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
}
// If caller did not specify Pids Limits load default
- if s.ResourceLimits == nil || s.ResourceLimits.Pids == nil {
- if s.CgroupsMode != "disabled" {
- limit := rtc.PidsLimit()
- if limit != 0 {
- if s.ResourceLimits == nil {
- s.ResourceLimits = &spec.LinuxResources{}
- }
- s.ResourceLimits.Pids = &spec.LinuxPids{
- Limit: limit,
- }
- }
- }
- }
+ s.InitResourceLimits(rtc)
if s.LogConfiguration == nil {
s.LogConfiguration = &specgen.LogConfig{}