Skip to content

Commit 4d3de91

Browse files
committed
Addressing comments
1 parent cf34795 commit 4d3de91

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cns/service/main.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,8 @@ func registerNode(httpc *http.Client, httpRestService cns.HTTPService, dncEP, in
288288
}
289289
time.Sleep(acn.FiveSeconds)
290290
}
291-
logger.Errorf("[Azure CNS] Failed to register node %s after maximum reties for an hour with Infrastructure Network: %s PrivateEndpoint: %s",
291+
return fmt.Errorf("[Azure CNS] Failed to register node %s after maximum reties for an hour with Infrastructure Network: %s PrivateEndpoint: %s",
292292
nodeID, infraVnet, dncEP)
293-
return nil
294293
}
295294

296295
// sendRegisterNodeRequest func helps in registering the node until there is an error.
@@ -322,14 +321,14 @@ func sendRegisterNodeRequest(
322321
if response.StatusCode != http.StatusCreated {
323322
err = fmt.Errorf("[Azure CNS] Failed to register node, DNC replied with http status code %s", strconv.Itoa(response.StatusCode))
324323
logger.Errorf(err.Error())
325-
return false, err
324+
return false, nil
326325
}
327326

328327
var req cns.SetOrchestratorTypeRequest
329328
err = json.NewDecoder(response.Body).Decode(&req)
330329
if err != nil {
331-
log.Errorf("[Azure CNS] decoding Node Resgister response json failed with non-retriable err %v", err)
332-
return false, err
330+
log.Errorf("[Azure CNS] decoding Node Resgister response json failed with err %v", err)
331+
return false, nil
333332
}
334333
httpRestService.SetNodeOrchestrator(&req)
335334

0 commit comments

Comments
 (0)