Skip to content

Commit

Permalink
fix(status): fix ready condition in status.
Browse files Browse the repository at this point in the history
refactor GetHealth method, using in-cluster service to get health.
  • Loading branch information
wangcanfeng committed Sep 16, 2020
1 parent 5581325 commit 98b40f8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controllers/harbor/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ func (r *Reconciler) GetHealth(ctx context.Context, harbor *goharborv1alpha1.Har

// access in-cluster service
resp, err := http.Get(fmt.Sprintf("http://%s.%s%s", harbor.NormalizeComponentName(goharborv1alpha1.CoreName), harbor.GetNamespace(), HarborHealthEndpoint))

if err != nil {
return nil, errors.Wrap(err, "cannot get health response")
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)

if err != nil {
return nil, errors.Wrap(err, "cannot get health response body.")
}
Expand Down

0 comments on commit 98b40f8

Please sign in to comment.