mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-17 23:57:49 +00:00
kubectl should use UnstructuredJSONScheme to decode version and kind, as it throws errors if either are missing]
This commit is contained in:
parent
2bb0fc00e5
commit
627b2f9a24
@ -42,7 +42,7 @@ func (m *Mapper) InfoForData(data []byte, source string) (*Info, error) {
|
|||||||
return nil, fmt.Errorf("unable to parse %q: %v", source, err)
|
return nil, fmt.Errorf("unable to parse %q: %v", source, err)
|
||||||
}
|
}
|
||||||
data = json
|
data = json
|
||||||
version, kind, err := m.DataVersionAndKind(data)
|
version, kind, err := runtime.UnstructuredJSONScheme.DataVersionAndKind(data)
|
||||||
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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user