mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 10:19:50 +00:00
check the value of min and max
This commit is contained in:
parent
545f749a0d
commit
4bbc3ba7b1
@ -97,6 +97,11 @@ func generateHPA(genericParams map[string]interface{}) (runtime.Object, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if min > max {
|
||||||
|
return nil, fmt.Errorf("'max' must be greater than or equal to 'min'.")
|
||||||
|
}
|
||||||
|
|
||||||
cpuString, found := params["cpu-percent"]
|
cpuString, found := params["cpu-percent"]
|
||||||
cpu := -1
|
cpu := -1
|
||||||
if found {
|
if found {
|
||||||
|
Loading…
Reference in New Issue
Block a user