Skip to content

Commit

Permalink
Merge pull request #554 from kubescape/fix_c_0050
Browse files Browse the repository at this point in the history
fix control C-0050
  • Loading branch information
kooomix authored Dec 13, 2023
2 parents 84db4a8 + 52c2791 commit daf0773
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions rules/resources-cpu-limit-and-request/raw.rego
Original file line number Diff line number Diff line change
Expand Up @@ -350,29 +350,29 @@ compare_max(max, given) {
endswith(given, "Mi")
split_max := split(max, "Mi")[0]
split_given := split(given, "Mi")[0]
split_given > split_max
to_number(split_given) > to_number(split_max)
}

compare_max(max, given) {
endswith(max, "M")
endswith(given, "M")
split_max := split(max, "M")[0]
split_given := split(given, "M")[0]
split_given > split_max
to_number(split_given) > to_number(split_max)
}

compare_max(max, given) {
endswith(max, "m")
endswith(given, "m")
split_max := split(max, "m")[0]
split_given := split(given, "m")[0]
split_given > split_max
to_number(split_given) > to_number(split_max)
}

compare_max(max, given) {
not is_special_measure(max)
not is_special_measure(given)
given > max
to_number(given) > to_number(max)
}


Expand All @@ -384,29 +384,31 @@ compare_min(min, given) {
endswith(given, "Mi")
split_min := split(min, "Mi")[0]
split_given := split(given, "Mi")[0]
split_given < split_min
to_number(split_given) < to_number(split_min)
}

compare_min(min, given) {
endswith(min, "M")
endswith(given, "M")
split_min := split(min, "M")[0]
split_given := split(given, "M")[0]
split_given < split_min
to_number(split_given) < to_number(split_min)
}

compare_min(min, given) {
endswith(min, "m")
endswith(given, "m")
split_min := split(min, "m")[0]
split_given := split(given, "m")[0]
split_given < split_min
to_number(split_given) < to_number(split_min)

}

compare_min(min, given) {
not is_special_measure(min)
not is_special_measure(given)
given < min
to_number(given) < to_number(min)

}


Expand Down

0 comments on commit daf0773

Please sign in to comment.