Skip to content

Commit f764c8a

Browse files
fix: update comments
1 parent 03b2531 commit f764c8a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

cns/restserver/nodesubnet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (service *HTTPRestService) InitializeNodeSubnet(ctx context.Context, podInf
5151
return errors.Wrap(err, "reconcile initial CNS state")
5252
}
5353
// statefile (if any) is reconciled. Initialize the IP fetcher. Start the IP fetcher only after the service is started,
54-
// and any pending async delete operations are completed.
54+
// because starting the IP fetcher will generate conflist, which should be done only once we are ready to respond to IPAM requests.
5555
service.nodesubnetIPFetcher = nodesubnet.NewIPFetcher(service.nma, service, 0, 0, logger.Log)
5656

5757
return nil

cns/service/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,8 +1046,9 @@ func main() {
10461046
}
10471047

10481048
if config.ChannelMode == cns.AzureHost {
1049-
// at this point, rest service is running, and any pending async deletes have been submitted to the rest
1050-
// service. We can now start serving new requests.
1049+
// at this point, rest service is running. We can now start serving new requests. So call StartNodeSubnet, which
1050+
// will fetch secondary IPs and generate conflist. Do not move this all before rest service start - this will cause
1051+
// CNI to start sending requests, and if the service doesn't start successfully, the requests will fail.
10511052
httpRemoteRestService.StartNodeSubnet(rootCtx)
10521053
}
10531054

0 commit comments

Comments
 (0)