mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 13:31:52 +00:00
remove error wrapping from builder
This commit is contained in:
parent
365cbe1b41
commit
e821e0de15
@ -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
|
||||
}
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user