weave-gitops icon indicating copy to clipboard operation
weave-gitops copied to clipboard

Wrong status message displayed for HorizontalPodAutoscaler

Open makkes opened this issue 2 years ago • 2 comments

Describe the bug

I have an HorizontalPodAutoscaler that has the following .spec.status:

status:
  conditions:
  - lastTransitionTime: "2023-03-01T16:49:53Z"
    message: the HPA controller was able to get the target's current scale
    reason: SucceededGetScale
    status: "True"
    type: AbleToScale
  - lastTransitionTime: "2023-03-01T16:50:08Z"
    message: 'the HPA was unable to compute the replica count: failed to get cpu utilization:
      unable to get metrics for resource cpu: unable to fetch metrics from resource
      metrics API: the server could not find the requested resource (get pods.metrics.k8s.io)'
    reason: FailedGetResourceMetric
    status: "False"
    type: Scaling

The UI correctly shows that it's not ready but renders the wrong message:

2023-03-01_17-55

The message that should be shows instead is the one causing the resource to be shown as not ready, i.e. "the HPA was unable to compute the replica count...".

makkes avatar Mar 01 '23 16:03 makkes

@JamWils fyi

makkes avatar Mar 01 '23 16:03 makkes

On top of this, even when the HPA status is good, weave-gitops shows not ready.

We got the following status:

status:
  conditions:
  - lastTransitionTime: "2023-09-09T18:33:56Z"
    message: recent recommendations were higher than current one, applying the highest
      recent recommendation
    reason: ScaleDownStabilized
    status: "True"
    type: AbleToScale
  - lastTransitionTime: "2023-10-05T09:14:23Z"
    message: the HPA was able to successfully calculate a replica count from cpu resource
      utilization (percentage of request)
    reason: ValidMetricFound
    status: "True"
    type: ScalingActive
  - lastTransitionTime: "2023-10-05T09:14:38Z"
    message: the desired count is within the acceptable range
    reason: DesiredWithinRange
    status: "False"
    type: ScalingLimited

This means that everything is right and working well but the UI shows Not Ready

Cajga avatar Oct 05 '23 10:10 Cajga