Fix(kube):fix kube show rounding issue EE-2115 (#6300)

* fix/ee-2115/kube-show-rounding
pull/6476/head
sunportainer 3 years ago committed by GitHub
parent 61be10bb00
commit 118809a9c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -63,6 +63,7 @@ class KubernetesClusterController {
_.forEach(nodes, (node) => (node.Memory = filesizeParser(node.Memory)));
this.nodes = nodes;
this.CPULimit = _.reduce(this.nodes, (acc, node) => node.CPU + acc, 0);
this.CPULimit = Math.round(this.CPULimit * 10000) / 10000;
this.MemoryLimit = _.reduce(this.nodes, (acc, node) => KubernetesResourceReservationHelper.megaBytesValue(node.Memory) + acc, 0);
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to retrieve nodes');

Loading…
Cancel
Save