mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-18 08:09:58 +00:00
If an isolator's request is nil, populate it with the limit and vice versa.
The appc spec isn't currently clear about if both fields are required, and before rkt v0.8.1 if either field was nil it would result in a crash. Currently rkt will ignore isolators that don't have both fields set, so I think this is a reasonable approach to making sure isolators are actually used.
This commit is contained in:
parent
0f8cc8926f
commit
ad085f78fe
@ -214,10 +214,10 @@ func rawValue(value string) *json.RawMessage {
|
||||
// rawValue converts the request, limit to *json.RawMessage
|
||||
func rawRequestLimit(request, limit string) *json.RawMessage {
|
||||
if request == "" {
|
||||
return rawValue(fmt.Sprintf(`{"limit":%q}`, limit))
|
||||
request = limit
|
||||
}
|
||||
if limit == "" {
|
||||
return rawValue(fmt.Sprintf(`{"request":%q}`, request))
|
||||
limit = request
|
||||
}
|
||||
return rawValue(fmt.Sprintf(`{"request":%q,"limit":%q}`, request, limit))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user