-
Notifications
You must be signed in to change notification settings - Fork 260
Add a go routine to update NC host version from NMAgent periodically. #714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #714 +/- ##
==========================================
+ Coverage 39.61% 39.69% +0.08%
==========================================
Files 82 82
Lines 10800 10858 +58
==========================================
+ Hits 4278 4310 +32
- Misses 6017 6031 +14
- Partials 505 517 +12 |
f97a86e to
bc35910
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
392f83d to
71bb051
Compare
cns/restserver/internalapi.go
Outdated
|
|
||
| // SyncHostNCVersion will check NC version from NMAgent and save it as host NC version in container status. | ||
| // If NMAgent NC version got updated, CNS will refresh the pending programming IP status. | ||
| func (service *HTTPRestService) SyncHostNCVersion(ctx context.Context, channelMode string, lastUpdatedHostNCTimeStamp time.Time, forceMarkIPAvailableTimeRange time.Duration) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I highly recommend to move this to a separate file (like IPAMPoolMonitor). we only add apis called by internal cns client in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is not for internal cns call from begining. It's AKS start using it for internal CNS call. There are 6 functions in internalapi.go, only 2 of them are called by cns client. CreateOrUpdateNetworkContainerInternal and ReconcileNCState are called by cns client. The rest of 4 are not called by cns client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could I remain the function here for this version?
I can do moving logic to separate file for next PR and we can move all the related logic, including what managed DNC use in a separate file.
6a6fa28 to
946cbbf
Compare
If orchestrator type is CRD, update pending programming IPs as well.
…tate as Avaialable instead of pending programming.
Resovle conflicts manually. Update unit test nc version value. Update unit test nc version. Add get nmagent default value back for integ testing purpose. Unit test can be break by this change. Update default new IP CNS status to available. Assign value to host version if none exist in util.go Addressed feedback and perform cluster integ test with 1 sec frequent nc version update. Need to clean logNCSnapshots when send out PR. Update nc version associate with secondary ip. Add new nmagent api test. Add versionResponseWithoutToken.Containers log Add containerId from our runner sub. Add containerId from NMAgent team. Addressed feedback and add real nmagent logic. Add timeout when query nmagent for nc version.
This is the final version. Change the way of http get request to add context. Change channel to no buffer with same goroutine. Found always fall in ctx.Done() condition. Add channel close for get nc version list. Add milisecond unit for timeout. Testing with different context version.
… retry if no response from NMAgent. Release pending programming IP when scale down.
f48b691 to
4dc342e
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…ion inside CreateNetworkContainerRequest.
| return | ||
| } | ||
|
|
||
| nmaclient, err := nmagentclient.NewNMAgentClient("") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the use of having empty param to this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case we want to override nmagent client url.
Can't find where is this request. Sync up offline we can merege it first.
feat:
Reason for Change:
NC version from DNC can be different with NC version from NMAgent when NMAgent didn't keep up the NC version change from DNC side.
This feature enable CNS sync NC version from NMAgent periodically and update related info.
fix: Bug Fixes 🐞
test: Testing 💚