@backstage/plugin-kubernetes 0.0.0-nightly-20220530025009 → 0.0.0-nightly-20220602024936

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,15 +1,32 @@
1
1
  # @backstage/plugin-kubernetes
2
2
 
3
- ## 0.0.0-nightly-20220530025009
3
+ ## 0.0.0-nightly-20220602024936
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - 4328737af6: Add support to fetch data for Stateful Sets and display an accordion in the same way as with Deployments
8
+ - b9b8bbc7d9: show request/limit CPU and Memory on the UI
9
+ - 8f7b1835df: Updated dependency `msw` to `^0.41.0`.
8
10
  - 81304e3e91: Fix for HPA matching when deploying same HPA in multiple namespaces
9
11
  - Updated dependencies
10
- - @backstage/plugin-catalog-react@0.0.0-nightly-20220530025009
11
- - @backstage/core-components@0.0.0-nightly-20220530025009
12
- - @backstage/plugin-kubernetes-common@0.0.0-nightly-20220530025009
12
+ - @backstage/plugin-catalog-react@0.0.0-nightly-20220602024936
13
+ - @backstage/core-components@0.0.0-nightly-20220602024936
14
+ - @backstage/plugin-kubernetes-common@0.0.0-nightly-20220602024936
15
+ - @backstage/core-plugin-api@0.0.0-nightly-20220602024936
16
+ - @backstage/catalog-model@0.0.0-nightly-20220602024936
17
+
18
+ ## 0.6.6-next.1
19
+
20
+ ### Patch Changes
21
+
22
+ - b9b8bbc7d9: show request/limit CPU and Memory on the UI
23
+ - 8f7b1835df: Updated dependency `msw` to `^0.41.0`.
24
+ - Updated dependencies
25
+ - @backstage/core-components@0.9.5-next.1
26
+ - @backstage/core-plugin-api@1.0.3-next.0
27
+ - @backstage/catalog-model@1.0.3-next.0
28
+ - @backstage/plugin-catalog-react@1.1.1-next.1
29
+ - @backstage/plugin-kubernetes-common@0.3.0-next.1
13
30
 
14
31
  ## 0.6.6-next.0
15
32
 
package/dist/index.esm.js CHANGED
@@ -440,6 +440,9 @@ const currentToDeclaredResourceToPerc = (current, resource) => {
440
440
  const denominator = BigInt(resource);
441
441
  return `${numerator * BigInt(100) / denominator}%`;
442
442
  };
443
+ const formatMilicores = (value) => {
444
+ return `${parseFloat(value.toString()) * 1e3}m`;
445
+ };
443
446
  const podStatusToCpuUtil = (podStatus) => {
444
447
  const cpuUtil = podStatus.cpu;
445
448
  let currentUsage = cpuUtil.currentUsage;
@@ -447,15 +450,18 @@ const podStatusToCpuUtil = (podStatus) => {
447
450
  currentUsage = cpuUtil.currentUsage / 10;
448
451
  }
449
452
  return /* @__PURE__ */ React__default.createElement(SubvalueCell, {
450
- value: `requests: ${currentToDeclaredResourceToPerc(currentUsage, cpuUtil.requestTotal)}`,
451
- subvalue: `limits: ${currentToDeclaredResourceToPerc(currentUsage, cpuUtil.limitTotal)}`
453
+ value: `requests: ${currentToDeclaredResourceToPerc(currentUsage, cpuUtil.requestTotal)} of ${formatMilicores(cpuUtil.requestTotal)}`,
454
+ subvalue: `limits: ${currentToDeclaredResourceToPerc(currentUsage, cpuUtil.limitTotal)} of ${formatMilicores(cpuUtil.limitTotal)}`
452
455
  });
453
456
  };
457
+ const bytesToMiB = (value) => {
458
+ return `${parseFloat(value.toString()) / 1024 / 1024}MiB`;
459
+ };
454
460
  const podStatusToMemoryUtil = (podStatus) => {
455
461
  const memUtil = podStatus.memory;
456
462
  return /* @__PURE__ */ React__default.createElement(SubvalueCell, {
457
- value: `requests: ${currentToDeclaredResourceToPerc(memUtil.currentUsage, memUtil.requestTotal)}`,
458
- subvalue: `limits: ${currentToDeclaredResourceToPerc(memUtil.currentUsage, memUtil.limitTotal)}`
463
+ value: `requests: ${currentToDeclaredResourceToPerc(memUtil.currentUsage, memUtil.requestTotal)} of ${bytesToMiB(memUtil.requestTotal)}`,
464
+ subvalue: `limits: ${currentToDeclaredResourceToPerc(memUtil.currentUsage, memUtil.limitTotal)} of ${bytesToMiB(memUtil.limitTotal)}`
459
465
  });
460
466
  };
461
467