Skip to content

Commit fc21de5

Browse files
committed
Correctly wrap the ErrNodeInvalidOwner error
1 parent 83be4eb commit fc21de5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

vertical-pod-autoscaler/pkg/target/controller_fetcher/controller_fetcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func (f *controllerFetcher) getParentOfController(ctx context.Context, controlle
210210
return nil, nil
211211
}
212212
if err != nil {
213-
return nil, fmt.Errorf("unhandled targetRef %s / %s / %s, last error %v",
213+
return nil, fmt.Errorf("unhandled targetRef %s / %s / %s, last error %w",
214214
controllerKey.ApiVersion, controllerKey.Kind, controllerKey.Name, err)
215215
}
216216

vertical-pod-autoscaler/pkg/target/controller_fetcher/controller_fetcher_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ func TestControllerFetcher(t *testing.T) {
389389
},
390390
}},
391391
expectedKey: nil,
392-
expectedError: fmt.Errorf("unhandled targetRef v1 / Node / node, last error node is not a valid owner"),
392+
expectedError: fmt.Errorf("unhandled targetRef v1 / Node / node, last error %w", ErrNodeInvalidOwner),
393393
},
394394
{
395395
name: "custom resource with no scale subresource",

0 commit comments

Comments
 (0)