Revert "Revert "Enhance error message from kubectl when 'kind' is empty""

This commit is contained in:
Clayton Coleman 2015-05-20 17:32:23 -04:00
parent a76bdd9710
commit 0a28e50511

View File

@ -46,6 +46,9 @@ func (m *Mapper) InfoForData(data []byte, source string) (*Info, error) {
if err != nil {
return nil, fmt.Errorf("unable to get type info from %q: %v", source, err)
}
if kind == "" {
return nil, fmt.Errorf("kind not set in %q", source)
}
mapping, err := m.RESTMapping(kind, version)
if err != nil {
return nil, fmt.Errorf("unable to recognize %q: %v", source, err)