kubernetes/pkg/controller/podautoscaler/metrics
Mike Fedosin 86f94fda0c
Fix error formatting and use proper error wrapping in HPA controller (#139029)
* Fix format-string argument order in object metric error messages

The error format strings in GetObjectMetricReplicas and
GetObjectPerPodMetricReplicas had the arguments in the wrong order,
causing objectRef.Kind to be printed where the error should appear
and vice versa.

Signed-off-by: Mikhail Fedosin <mfedosin@redhat.com>

* Use %w for error wrapping in fmt.Errorf calls in podautoscaler

Replace %v with %w for error arguments in fmt.Errorf throughout the
HPA controller, replica calculator, and metrics client. This enables
proper error wrapping so that callers can use errors.Is and errors.As
to inspect underlying errors.

Signed-off-by: Mikhail Fedosin <mfedosin@redhat.com>

---------

Signed-off-by: Mikhail Fedosin <mfedosin@redhat.com>
2026-05-18 20:47:54 +05:30
..
client.go Fix error formatting and use proper error wrapping in HPA controller (#139029) 2026-05-18 20:47:54 +05:30
client_test.go cleanup: remove redundant type conversions in podautoscaler 2025-08-28 14:28:57 +08:00
interfaces.go allow ContainerResource calculations to continue with missing metrics like Resource calculations 2024-10-06 11:27:21 -04:00
utilization.go requested changes: fix return type variables 2022-09-22 08:59:02 +00:00
utilization_test.go fix: enable testifylint on pkg/controller 2024-07-12 06:18:34 +00:00