fix cpu parsing logic (#10808)

pull/10838/head
Prabhat Khera 12 months ago committed by GitHub
parent 6ff6fd7f75
commit 32d8dc311b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,9 +28,17 @@ class KubernetesResourceReservationHelper {
static parseCPU(cpu) {
let res = parseInt(cpu, 10);
if (_.endsWith(cpu, 'm')) {
// milli
res /= 1000;
} else if (_.endsWith(cpu, 'u')) {
// micro
res /= 1000000;
} else if (_.endsWith(cpu, 'n')) {
// nano
res /= 1000000000;
} else if (_.endsWith(cpu, 'p')) {
// pico
res /= 1000000000000;
}
return res;
}

Loading…
Cancel
Save