Skip to content

Commit

Permalink
fix: context cancel (#1350)
Browse files Browse the repository at this point in the history
Co-authored-by: Asim Aslam <asim@aslam.me>
  • Loading branch information
lpxxn and asim committed Mar 16, 2020
1 parent ac333d9 commit 5712aaf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions util/kubernetes/client/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ func newWatcher(req *api.Request) (Watcher, error) {
// do the raw request
res, err := req.Raw()
if err != nil {
cancel()
return nil, err
}

if res.StatusCode < 200 || res.StatusCode >= 300 {
cancel()
// close the response body
res.Body.Close()
// return an error
Expand Down

0 comments on commit 5712aaf

Please sign in to comment.