diff --git a/packages/forklift-console-plugin/src/modules/Plans/views/details/tabs/Resources/OpenshiftPlanResources.tsx b/packages/forklift-console-plugin/src/modules/Plans/views/details/tabs/Resources/OpenshiftPlanResources.tsx index 90cd2b5b8..532fc2f95 100644 --- a/packages/forklift-console-plugin/src/modules/Plans/views/details/tabs/Resources/OpenshiftPlanResources.tsx +++ b/packages/forklift-console-plugin/src/modules/Plans/views/details/tabs/Resources/OpenshiftPlanResources.tsx @@ -35,6 +35,9 @@ export const OpenshiftPlanResources: React.FC<{ planInventory: OpenshiftVM[] }> { cpuCount: 0, memoryMB: 0 }, ); + const missingCPUInfo = planInventory.find(({ object }) => getK8sCPU(object) === '0'); + const missingMemoryInfo = planInventory.find(({ object }) => getK8sVMMemory(object) === '0Mi'); + return ( @@ -56,15 +59,15 @@ export const OpenshiftPlanResources: React.FC<{ planInventory: OpenshiftVM[] }> {t('Total CPU count:')} - {totalResources.cpuCount || '-'} Cores - {totalResourcesRunning.cpuCount || '-'} Cores + {missingCPUInfo ? '-' : `${totalResources.cpuCount} Cores`} + {missingCPUInfo ? '-' : `${totalResourcesRunning.cpuCount} Cores`} {t('Total memory:')} - {totalResources.memoryMB || '-'} MB - {totalResourcesRunning.memoryMB || '-'} MB + {missingMemoryInfo ? '-' : `${totalResources.memoryMB} MB`} + {missingMemoryInfo ? '-' : `${totalResourcesRunning.memoryMB} MB`} diff --git a/packages/forklift-console-plugin/src/modules/Plans/views/details/tabs/Resources/OpenstackPlanResources.tsx b/packages/forklift-console-plugin/src/modules/Plans/views/details/tabs/Resources/OpenstackPlanResources.tsx index 6e61275f4..a36f79125 100644 --- a/packages/forklift-console-plugin/src/modules/Plans/views/details/tabs/Resources/OpenstackPlanResources.tsx +++ b/packages/forklift-console-plugin/src/modules/Plans/views/details/tabs/Resources/OpenstackPlanResources.tsx @@ -34,15 +34,15 @@ export const OpenstackPlanResources: React.FC<{ planInventory: OpenstackVM[] }> {t('Total CPU count:')} - - Cores - - Cores + - + - {t('Total memory:')} - - MB - - MB + - + -