Skip to content

Commit b3e4e51

Browse files
authored
Merge pull request #7845 from bboreham/idiomatic-err-wrap
VPA: wrap clusterStateFeeder error idiomatically
2 parents c5f1d25 + 2ad8eb7 commit b3e4e51

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

vertical-pod-autoscaler/pkg/recommender/input/cluster_feeder.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"slices"
2424
"time"
2525

26-
"github.com/pkg/errors"
2726
apiv1 "k8s.io/api/core/v1"
2827
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2928
"k8s.io/apimachinery/pkg/fields"
@@ -349,7 +348,7 @@ func (feeder *clusterStateFeeder) cleanupCheckpointsForNamespace(namespace strin
349348
vpaID := model.VpaID{Namespace: checkpoint.Namespace, VpaName: checkpoint.Spec.VPAObjectName}
350349
if !allVPAKeys[vpaID] {
351350
if errFeeder := feeder.vpaCheckpointClient.VerticalPodAutoscalerCheckpoints(namespace).Delete(context.TODO(), checkpoint.Name, metav1.DeleteOptions{}); errFeeder != nil {
352-
err = errors.Wrapf(err, "failed to delete orphaned checkpoint %s", klog.KRef(namespace, checkpoint.Name))
351+
err = fmt.Errorf("failed to delete orphaned checkpoint %s: %w", klog.KRef(namespace, checkpoint.Name), err)
353352
continue
354353
}
355354
klog.V(3).InfoS("Orphaned VPA checkpoint cleanup - deleting", "checkpoint", klog.KRef(namespace, checkpoint.Name))

0 commit comments

Comments
 (0)