mirror of
https://github.com/containers/podman.git
synced 2025-12-01 02:27:13 +08:00
Also includes a small change to make us of https://github.com/containers/buildah/pull/5039 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
17 lines
305 B
Go
17 lines
305 B
Go
package util
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/docker/go-units"
|
|
)
|
|
|
|
func ParseUlimit(ulimit string) (*units.Ulimit, error) {
|
|
ul, err := units.ParseUlimit(ulimit)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("ulimit option %q requires name=SOFT:HARD, failed to be parsed: %w", ulimit, err)
|
|
}
|
|
|
|
return ul, nil
|
|
}
|