Skip to content

Commit

Permalink
fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
smittal22 committed Dec 12, 2023
1 parent f837907 commit 41c9d6d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cns/service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,11 @@ func registerNode(ctx context.Context, httpClient httpDoer, httpRestService cns.
supportedApis, retErr := ni.SupportedAPIs(context.TODO())

if retErr != nil {
logger.Errorf("[Azure CNS] Failed to retrieve SupportedApis from NMagent of node %s with Infrastructure Network: %s PrivateEndpoint: %s",
nodeID, infraVnet, dncEP)
return retErr
return errors.Wrap(retErr, fmt.Sprintf("[Azure CNS] Failed to retrieve SupportedApis from NMagent of node %s with Infrastructure Network: %s PrivateEndpoint: %s",
nodeID, infraVnet, dncEP))
}

// To avoid any null-pointer deferencing errors.
// To avoid any null-pointer de-referencing errors.
if supportedApis == nil {
supportedApis = []string{}
}
Expand All @@ -403,7 +402,7 @@ func registerNode(ctx context.Context, httpClient httpDoer, httpRestService cns.

// CNS tries to register Node for maximum of an hour.
err := retry.Do(func() error {
return errors.Wrap(sendRegisterNodeRequest(ctx, httpClient, httpRestService, nodeRegisterRequest, url), "failed to build request")
return errors.Wrap(sendRegisterNodeRequest(ctx, httpClient, httpRestService, nodeRegisterRequest, url), "failed to sendRegisterNodeRequest")
}, retry.Delay(acn.FiveSeconds), retry.Attempts(maxRetryNodeRegister), retry.DelayType(retry.FixedDelay))

return errors.Wrap(err, fmt.Sprintf("[Azure CNS] Failed to register node %s after maximum reties for an hour with Infrastructure Network: %s PrivateEndpoint: %s",
Expand Down

0 comments on commit 41c9d6d

Please sign in to comment.