fix: close resp.body checking for kubernetes version (#16547)

This commit is contained in:
jiuker 2023-02-07 02:41:41 +08:00 committed by GitHub
parent 14cf8f1b22
commit a451d1cb8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1901,7 +1901,7 @@ func getKubernetesInfo(dctx context.Context) madmin.KubernetesInfo {
ki.Error = err.Error()
return ki
}
defer resp.Body.Close()
decoder := json.NewDecoder(resp.Body)
if err := decoder.Decode(&ki); err != nil {
ki.Error = err.Error()