File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -26,19 +26,19 @@ func init() {
2626// then the checks registered to the handler will test for those expectations. For example, in
2727// ChannelMode: CRD, the health check will ensure that CNS is able to list NNCs successfully.
2828func NewHealthzHandlerWithChecks (cnsConfig * configuration.CNSConfig ) (http.Handler , error ) {
29- cfg , err := ctrl .GetConfig ()
30- if err != nil {
31- return nil , errors .Wrap (err , "unable to get a kubeconfig" )
32- }
33- cli , err := client .New (cfg , client.Options {
34- Scheme : scheme ,
35- })
36- if err != nil {
37- return nil , errors .Wrap (err , "unable to create a client" )
38- }
39-
4029 checks := make (map [string ]healthz.Checker )
4130 if cnsConfig .ChannelMode == cns .CRD {
31+ cfg , err := ctrl .GetConfig ()
32+ if err != nil {
33+ return nil , errors .Wrap (err , "failed to get kubeconfig" )
34+ }
35+ cli , err := client .New (cfg , client.Options {
36+ Scheme : scheme ,
37+ })
38+ if err != nil {
39+ return nil , errors .Wrap (err , "failed to build client" )
40+ }
41+
4242 checks ["nnc" ] = func (req * http.Request ) error {
4343 ctx := req .Context ()
4444 // we just care that we're allowed to List NNCs so set limit to 1 to minimize
You can’t perform that action at this time.
0 commit comments