Skip to content

Commit

Permalink
remove error wrapping from builder
Browse files Browse the repository at this point in the history
Kubernetes-commit: e821e0de15ea45be5885088d4a08ea9aaba2b184
  • Loading branch information
IvoGoman authored and k8s-publishing-bot committed Feb 8, 2024
1 parent 95524db commit b9cc986
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/resource/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ func (b *Builder) mappingFor(resourceOrKindArg string) (*meta.RESTMapping, error
// if the error is _not_ a *meta.NoKindMatchError, then we had trouble doing discovery,
// so we should return the original error since it may help a user diagnose what is actually wrong
if meta.IsNoMatchError(err) {
return nil, fmt.Errorf("the server doesn't have a resource type %q: %w", groupResource.Resource, err)
return nil, fmt.Errorf("the server doesn't have a resource type %q", groupResource.Resource)
}
return nil, err
}
Expand Down
3 changes: 0 additions & 3 deletions pkg/resource/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1053,9 +1053,6 @@ func TestRestMappingErrors(t *testing.T) {
if !strings.Contains(err.Error(), "server doesn't have a resource type \"foo\"") {
t.Fatalf("unexpected error: %v", err)
}
if !errors.Is(err, &meta.NoKindMatchError{}) {
t.Fatalf("unexpected error type: %v", err)
}
}

expectedErr := fmt.Errorf("expected error")
Expand Down

0 comments on commit b9cc986

Please sign in to comment.