kubernetes/pkg/controller
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
..
apis/config Explicitly disable validation-gen where not needed 2026-05-12 12:49:01 -04:00
bootstrap Move dump package from apimachinery to k8s.io/utils 2026-02-12 07:34:19 -05:00
certificates Generate deepcopy 2026-05-11 12:27:56 -04:00
clusterroleaggregation simplify cluster role aggregation and remove update path 2026-02-02 22:39:27 +00:00
cronjob Generate deepcopy 2026-05-11 12:27:56 -04:00
daemon Generate deepcopy 2026-05-11 12:27:56 -04:00
deployment Generate deepcopy 2026-05-11 12:27:56 -04:00
devicetainteviction Generate deepcopy 2026-05-11 12:27:56 -04:00
disruption Update pkg/controller to use slices.Contains 2026-02-26 10:17:13 +01:00
endpoint Generate deepcopy 2026-05-11 12:27:56 -04:00
endpointslice Generate deepcopy 2026-05-11 12:27:56 -04:00
endpointslicemirroring Generate deepcopy 2026-05-11 12:27:56 -04:00
garbagecollector Drop meaningless ,inline from json tags 2026-05-13 11:24:04 -04:00
history Add index for controller revision 2026-01-13 19:46:34 +00:00
job Generate deepcopy 2026-05-11 12:27:56 -04:00
namespace Generate deepcopy 2026-05-11 12:27:56 -04:00
nodeipam Generate deepcopy 2026-05-11 12:27:56 -04:00
nodelifecycle Generate deepcopy 2026-05-11 12:27:56 -04:00
podautoscaler Fix error formatting and use proper error wrapping in HPA controller (#139029) 2026-05-18 20:47:54 +05:30
podgc Generate deepcopy 2026-05-11 12:27:56 -04:00
replicaset Generate deepcopy 2026-05-11 12:27:56 -04:00
replication Generate deepcopy 2026-05-11 12:27:56 -04:00
resourceclaim Merge pull request #138657 from jpbetz/codegen-discovery 2026-05-13 01:16:37 +05:30
resourcepoolstatusrequest controller/resourcepoolstatusrequest: Improve goroutine mgmt 2026-04-20 18:28:14 +08:00
resourcequota Generate deepcopy 2026-05-11 12:27:56 -04:00
scheduling/podgroupprotection Update pkg/controller/scheduling/podgroupprotection/podgroup_protection_controller_test.go 2026-05-10 20:38:25 -04:00
serviceaccount Generate deepcopy 2026-05-11 12:27:56 -04:00
servicecidrs Update pkg/controller to use slices.Contains 2026-02-26 10:17:13 +01:00
statefulset Generate deepcopy 2026-05-11 12:27:56 -04:00
storageversiongc Merge pull request #134432 from Karthik-K-N/fix-sv-test 2025-11-05 06:56:52 -08:00
storageversionmigrator Drop meaningless ,inline from json tags 2026-05-13 11:24:04 -04:00
tainteviction KEP-5471: Extend tolerations operators (#134665) 2025-11-10 12:42:54 -08:00
testutil Replace NewFake with NewFakeWithOptions in pkg/controller 2025-09-11 08:39:49 +08:00
ttl controller/ttl: Improve goroutine mgmt 2025-10-29 19:04:37 +01:00
ttlafterfinished Generate deepcopy 2026-05-11 12:27:56 -04:00
util move protectionutil pkg to controller/util 2026-03-18 15:27:56 +00:00
validatingadmissionpolicystatus Generate deepcopy 2026-05-11 12:27:56 -04:00
volume Merge pull request #138981 from gnufied/implement-optimized-selinux-metric-emission 2026-05-18 16:53:51 +05:30
controller_ref_manager.go kube-controller-manager: finish conversion to contextual logging 2023-07-12 14:57:29 +02:00
controller_ref_manager_test.go
controller_utils.go Drop LogarithmicScaleDown after the feature GA-ed in 1.31 2026-05-04 16:27:43 +02:00
controller_utils_test.go Drop LogarithmicScaleDown after the feature GA-ed in 1.31 2026-05-04 16:27:43 +02:00
doc.go remove import doc comments 2024-12-02 16:59:34 +01:00
OWNERS Add jefftree to OWNERS 2025-08-04 19:12:13 +00:00