mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +00:00
Enhance error message from kubectl when 'kind' is empty
Enhance error message from kubectl when 'kind' is empty Enhance error message
This commit is contained in:
parent
a615799488
commit
6c8a1cdb17
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user