diff --git a/hack/verify.sh b/hack/verify.sh index 04ec12c799..9b25f7c487 100755 --- a/hack/verify.sh +++ b/hack/verify.sh @@ -42,6 +42,7 @@ golangci-lint run --disable-all \ --enable=lll \ --enable=dupl \ --enable=goimports \ + --enable=bodyclose \ ./pkg/... ./examples/... . # TODO: Enable these as we fix them to make them pass diff --git a/pkg/internal/testing/integration/internal/process.go b/pkg/internal/testing/integration/internal/process.go index 7084b0d5e7..8ecf1afe5c 100644 --- a/pkg/internal/testing/integration/internal/process.go +++ b/pkg/internal/testing/integration/internal/process.go @@ -170,9 +170,12 @@ func pollURLUntilOK(url url.URL, interval time.Duration, ready chan bool, stopCh } for { res, err := http.Get(url.String()) - if err == nil && res.StatusCode == http.StatusOK { - ready <- true - return + if err == nil { + res.Body.Close() + if res.StatusCode == http.StatusOK { + ready <- true + return + } } select {