-
Notifications
You must be signed in to change notification settings - Fork 260
Change version comparison from string to int and add more log in SyncHostNCVersion. #821
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 #821 +/- ##
==========================================
- Coverage 42.23% 42.04% -0.19%
==========================================
Files 152 152
Lines 14335 14379 +44
==========================================
- Hits 6054 6046 -8
- Misses 7554 7596 +42
- Partials 727 737 +10 |
1600635 to
5fcd7e0
Compare
ramiro-gamarra
left a comment
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.
A test should be added to the function that failed previously
cns/restserver/ipam.go
Outdated
| previousHostNCVersion := ncInfo.HostVersion | ||
| previousHostNCVersion, err := strconv.Atoi(ncInfo.HostVersion) | ||
| if err != nil { | ||
| logger.Printf("[MarkIpsAsAvailableUntransacted] Get int value from ncInfo.HostVersion %s failed for %v", ncInfo.HostVersion, err) |
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.
nit: better to use colon than for
[MarkIpsAsAvailableUntransacted] Get int value from ncInfo.HostVersion %s failed: %v
also, if it fails, the rest of the block should not execute, since it would be acting on previousHostNCVersion being 0. Probably should continue here
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'll return here.
… int to avoid bug when version 9 update to 10. 2. Add more log in SyncHostNCVersion. 3. Remove unnecessary check for MarkIpsAsAvailable. 4. Auto formatting.
fix: Change version comparison from string to int and as well as the following 3 improvements.
1. Add more log in SyncHostNCVersion.
2. Remove unnecessary check for MarkIpsAsAvailable.
3. Auto formatting.
Reason for Change:
Logs are not sufficient enough to debug.
Issue Fixed:
After these logs got added, it will unsure whether host version got updated.
In another word, after log got added, we are clear whether select sentence after channel got executed porperly.