Skip to content

Commit

Permalink
De-duplicate error logs
Browse files Browse the repository at this point in the history
  • Loading branch information
lkysow committed Nov 5, 2020
1 parent 380bb1e commit f5021a6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions connect-inject/health_check_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ func (h *HealthCheckResource) registerConsulHealthCheck(client *api.Client, cons
},
})
if err != nil {
h.Log.Error("unable to register health check with Consul from k8s", "err", err)
return err
return fmt.Errorf("registering health check for service %q: %s", serviceID, err)
}
return nil
}
Expand All @@ -221,8 +220,7 @@ func (h *HealthCheckResource) getServiceCheck(client *api.Client, healthCheckID
filter := fmt.Sprintf("CheckID == `%s`", healthCheckID)
checks, err := client.Agent().ChecksWithFilter(filter)
if err != nil {
h.Log.Error("unable to get agent health check", "checkID", healthCheckID, "filter", filter, "err", err)
return nil, err
return nil, fmt.Errorf("getting check %q: %s", healthCheckID, err)
}
// This will be nil (does not exist) or an actual check.
return checks[healthCheckID], nil
Expand Down

0 comments on commit f5021a6

Please sign in to comment.