mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
Fix kubelet to not accept negative eviction (hard, soft) thresholds
and add unit tests
This commit is contained in:
@@ -157,6 +157,10 @@ func parseThresholdStatement(statement string) (Threshold, error) {
|
||||
if err != nil {
|
||||
return Threshold{}, err
|
||||
}
|
||||
if quantity.Sign() < 0 {
|
||||
return Threshold{}, fmt.Errorf("eviction threshold %v cannot be negative: %s", signal, &quantity)
|
||||
}
|
||||
|
||||
return Threshold{
|
||||
Signal: signal,
|
||||
Operator: operator,
|
||||
|
||||
Reference in New Issue
Block a user