kubernetes/pkg
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
..
admission/plugin Add policy manifest loader, source, and plugin wiring 2026-03-11 23:47:55 -07:00
api switch tag Get("json") to Lookup("json") 2026-05-13 11:24:07 -04:00
apis Drop meaningless ,inline from json tags 2026-05-13 11:24:04 -04:00
auth Add the Unconditional prefix to Authorizer and WantsAuthorizer interfaces 2026-05-07 22:22:14 +03:00
capabilities
certauthorization Add the Unconditional prefix to Authorizer and WantsAuthorizer interfaces 2026-05-07 22:22:14 +03:00
client staging: extract CRI streaming modules with client-go compatibility 2026-03-12 09:59:55 -04:00
cluster/ports
controller Fix error formatting and use proper error wrapping in HPA controller (#139029) 2026-05-18 20:47:54 +05:30
controlplane Revert "KEP-5832: Implement PodGroup admission (#137464) 2026-05-12 21:00:23 +02:00
credentialprovider clean up: remove loop variable capture 2026-04-28 23:53:27 +02:00
features Add the ability for the hpa controller to read its own writes 2026-05-14 08:34:39 +00:00
fieldpath
generated Regenerate API docs 2026-05-13 11:24:08 -04:00
kubeapiserver Revert "KEP-5832: Implement PodGroup admission (#137464) 2026-05-12 21:00:23 +02:00
kubectl Create Workload API v1alpha2 (#136976) 2026-03-10 07:59:10 +05:30
kubelet Merge pull request #138367 from timmy-wright/timmy/fix-cleanup 2026-05-18 19:55:54 +05:30
kubemark remove portworx from in-tree volume plugins 2026-01-19 11:35:30 +08:00
printers Merge pull request #135964 from jaehanbyun/fix-storageclass-multiple-defaults 2026-04-23 03:19:13 +05:30
probe Remove redundant re-assignment in for-loops under pkg 2026-03-02 08:47:43 +01:00
proxy Explicitly disable validation-gen where not needed 2026-05-12 12:49:01 -04:00
quota/v1 Make quota evaluators in admission conditional on enabled resources 2026-02-20 11:34:33 -05:00
registry test/declarative_validation: migrate DV equivalence tests to new tree 2026-05-09 19:11:01 +00:00
routes build: remove deprecated '// +build' tag 2025-12-18 12:16:21 +01:00
scheduler Merge pull request #138710 from mm4tt/fix-preemptor-eligibility 2026-05-15 19:10:37 +05:30
security build: remove deprecated '// +build' tag 2025-12-18 12:16:21 +01:00
securitycontext clean up: remove loop variable capture 2026-04-28 23:53:27 +02:00
serviceaccount Service account controller: Wire through context 2025-12-04 19:30:55 -05:00
util Merge pull request #138389 from gheffern/add-safe-sysctls-135972 2026-05-12 22:04:31 +05:30
volume Promote volume metrics to beta and strengthen the tests 2026-05-05 10:48:17 -07:00
windows/service build: remove deprecated '// +build' tag 2025-12-18 12:16:21 +01:00
.import-restrictions
OWNERS