Merge pull request #8591 from GoogleCloudPlatform/revert-8564-revert-8404-messageEmptyKind

Revert "Revert "Enhance error message from kubectl when 'kind' is emp…
pull/6/head
Dawn Chen 2015-05-21 09:47:34 -07:00
commit 8fe43514ea
1 changed files with 3 additions and 0 deletions

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)