mirror of
https://github.com/containers/podman.git
synced 2025-05-17 06:59:07 +08:00

This avoids setting values in the spec which are not supported on FreeBSD - including these values causes warning messages for the unsupported features. [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
23 lines
507 B
Go
23 lines
507 B
Go
package specgen
|
|
|
|
import (
|
|
"github.com/containers/common/pkg/config"
|
|
spec "github.com/opencontainers/runtime-spec/specs-go"
|
|
)
|
|
|
|
func (s *SpecGenerator) InitResourceLimits(rtc *config.Config) {
|
|
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,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|