Commit b6c848c9 authored by Clayton Coleman's avatar Clayton Coleman

Merge pull request #8404 from feihujiang/messageEmptyKind

Enhance error message from kubectl when 'kind' is empty
parents a6157994 6c8a1cdb
...@@ -46,6 +46,9 @@ func (m *Mapper) InfoForData(data []byte, source string) (*Info, error) { ...@@ -46,6 +46,9 @@ func (m *Mapper) InfoForData(data []byte, source string) (*Info, error) {
if err != nil { if err != nil {
return nil, fmt.Errorf("unable to get type info from %q: %v", source, err) 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) mapping, err := m.RESTMapping(kind, version)
if err != nil { if err != nil {
return nil, fmt.Errorf("unable to recognize %q: %v", source, err) return nil, fmt.Errorf("unable to recognize %q: %v", source, err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment