mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
Merge pull request #8165 from feihujiang/checkjsonformat
Check json format firstly
This commit is contained in:
commit
6dbecc2a33
@ -59,7 +59,7 @@ func (SimpleMetaFactory) Interpret(data []byte) (version, kind string, err error
|
||||
}{}
|
||||
err = json.Unmarshal(data, &findKind)
|
||||
if err != nil {
|
||||
return "", "", fmt.Errorf("couldn't get version/kind: %v", err)
|
||||
return "", "", fmt.Errorf("couldn't get version/kind; json parse error: %v", err)
|
||||
}
|
||||
return findKind.APIVersion, findKind.Kind, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user