Skip to content

Commit 2ad8eb7

Browse files
committed
VPA: wrap clusterStateFeeder error idiomatically
The package `github.com/pkg/errors` has been archived, and it doesn't look like there is any requirement for its unique features. Instead, wrap the error using extended error feature added in Go 1.13. Background info at https://stackoverflow.com/a/61955455/448734 Signed-off-by: Bryan Boreham <[email protected]>
1 parent 2837c59 commit 2ad8eb7

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)