MCPcopy Create free account
hub / github.com/docker/compose / toUlimits

Function toUlimits

pkg/compose/create.go:708–726  ·  view source on GitHub ↗
(m map[string]*types.UlimitsConfig)

Source from the content-addressed store, hash-verified

706}
707
708func toUlimits(m map[string]*types.UlimitsConfig) []*container.Ulimit {
709 var ulimits []*container.Ulimit
710 for name, u := range m {
711 soft := u.Single
712 if u.Soft != 0 {
713 soft = u.Soft
714 }
715 hard := u.Single
716 if u.Hard != 0 {
717 hard = u.Hard
718 }
719 ulimits = append(ulimits, &container.Ulimit{
720 Name: name,
721 Hard: int64(hard),
722 Soft: int64(soft),
723 })
724 }
725 return ulimits
726}
727
728func setReservations(reservations *types.Resource, resources *container.Resources) {
729 if reservations == nil {

Callers 1

getDeployResourcesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected