Merge pull request #122569 from IvoGoman/wrap-nomatcherror

feat(cli-runtime): wrap meta.NoKindMatchErrors
This commit is contained in:
Kubernetes Prow Robot
2024-02-24 10:01:33 -08:00
committed by GitHub

View File

@@ -66,7 +66,7 @@ func (m *mapper) infoForData(data []byte, source string) (*Info, error) {
mapping, err := restMapper.RESTMapping(gvk.GroupKind(), gvk.Version)
if err != nil {
if _, ok := err.(*meta.NoKindMatchError); ok {
return nil, fmt.Errorf("resource mapping not found for name: %q namespace: %q from %q: %v\nensure CRDs are installed first",
return nil, fmt.Errorf("resource mapping not found for name: %q namespace: %q from %q: %w\nensure CRDs are installed first",
name, namespace, source, err)
}
return nil, fmt.Errorf("unable to recognize %q: %v", source, err)