mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
fix cpu parsing logic (#10808)
This commit is contained in:
parent
6ff6fd7f75
commit
32d8dc311b
1 changed files with 8 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue