[fix] add missing error check for HTTP req failure (#8071)

This commit is contained in:
James DeFelice 2020-09-08 14:13:23 -04:00 committed by GitHub
parent 6324b1fd63
commit 8c28661ca7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -207,6 +207,9 @@ func (k *Kubernetes) gatherPodInfo(baseURL string) ([]Metadata, error) {
func (k *Kubernetes) LoadJson(url string, v interface{}) error {
var req, err = http.NewRequest("GET", url, nil)
if err != nil {
return err
}
var resp *http.Response
tlsCfg, err := k.ClientConfig.TLSConfig()
if err != nil {