bump docker/go-units v0.4.0
relevant changes: - docker/go-units#19 make 1 second not to be plural seconds - docker/go-units#20 Add `HumanSizeWithPrecision` function - docker/go-units#21 change week display rule - docker/go-units#22 Better human duration precision - docker/go-units#23 Removes spaces before unit - docker/go-units#27 Fix #26 - RAMInBytes Bug - docker/go-units#33 Fix handling of unlimited (-1) ulimit values - docker/go-units#34 Revert 46 minute threshold Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
9
vendor/github.com/docker/go-units/ulimit.go
generated
vendored
9
vendor/github.com/docker/go-units/ulimit.go
generated
vendored
@@ -96,8 +96,13 @@ func ParseUlimit(val string) (*Ulimit, error) {
|
||||
return nil, fmt.Errorf("too many limit value arguments - %s, can only have up to two, `soft[:hard]`", parts[1])
|
||||
}
|
||||
|
||||
if soft > *hard {
|
||||
return nil, fmt.Errorf("ulimit soft limit must be less than or equal to hard limit: %d > %d", soft, *hard)
|
||||
if *hard != -1 {
|
||||
if soft == -1 {
|
||||
return nil, fmt.Errorf("ulimit soft limit must be less than or equal to hard limit: soft: -1 (unlimited), hard: %d", *hard)
|
||||
}
|
||||
if soft > *hard {
|
||||
return nil, fmt.Errorf("ulimit soft limit must be less than or equal to hard limit: %d > %d", soft, *hard)
|
||||
}
|
||||
}
|
||||
|
||||
return &Ulimit{Name: parts[0], Soft: soft, Hard: *hard}, nil
|
||||
|
||||
Reference in New Issue
Block a user