Skip to content

Commit 98db001

Browse files
committed
add new error var
1 parent 11080dc commit 98db001

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cns/healthserver/healthz.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@ func NewHealthzHandlerWithChecks(cfg *Config) (http.Handler, error) {
3838
if err != nil {
3939
return nil, errors.Wrap(err, "failed to get kubeconfig")
4040
}
41-
// Use the provided (test) RESTMapper when present; otherwise fall back to
42-
// a dynamic, discovery-based mapper for production.
41+
// Use the provided (test) RESTMapper when present; otherwise fall back to a dynamic, discovery-based mapper for production.
4342
mapper := cfg.Mapper
4443
if mapper == nil {
45-
httpClient, err := rest.HTTPClientFor(restCfg)
46-
if err != nil {
47-
return nil, errors.Wrap(err, "build http client for REST mapper")
44+
httpClient, httpErr := rest.HTTPClientFor(restCfg)
45+
if httpErr != nil {
46+
return nil, errors.Wrap(httpErr, "build http client for REST mapper")
4847
}
4948
mapper, err = apiutil.NewDynamicRESTMapper(restCfg, httpClient)
5049
if err != nil {

0 commit comments

Comments
 (0)