Fix HorizontalPodAutoscaler metrics not displaying current values (#5956)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2022-08-04 12:34:52 -04:00
1 parent 41389cefd9
commit 249927dc80
2 files changed
+163 -135

No files matched your search

@@ -63,27 +63,13 @@ class NonInjectedHpaDetails extends React.Component<HpaDetailsProps & Dependenci
case HpaMetricType.Resource: {
const metricSpec = metric.resource ?? metric.containerResource;
const addition = metricSpec.targetAverageUtilization
? "(as a percentage of request)"
? " (as a percentage of request)"
: "";
return (
<>
Resource
{metricSpec.name}
{" "}
on Pods
{addition}
</>
);
return `Resource ${metricSpec.name} on Pods${addition}`;
}
case HpaMetricType.Pods:
return (
<>
{metric.pods.metricName}
{" "}
on Pods
</>
);
return `${metric.pods.metricName} on Pods`;
case HpaMetricType.Object: {
return (
@@ -95,15 +81,7 @@ class NonInjectedHpaDetails extends React.Component<HpaDetailsProps & Dependenci
);
}
case HpaMetricType.External:
return (
<>
{metric.external.metricName}
{" "}
on
{" "}
{JSON.stringify(metric.external.metricSelector)}
</>
);
return `${metric.external.metricName} on ${JSON.stringify(metric.external.metricSelector)}`;
}
};