Skip to content

Conversation

@kmurudi
Copy link
Contributor

@kmurudi kmurudi commented Mar 19, 2021

Feat: [CNS] Debug API to expose In-Memory Data HTTPRestService
This commit has following changes -

  1. Removed AllocatedIPCount field from HTTPRestService struct in restserver.go as it is not used in project.
  2. Added debug command getInMemory and API to expose fields-HTTPRestService and 2 fields from IPAMPoolMonitor.
  3. Added Test function to test the new debug api response.

Reason for Change: Helping in debug commands for CNS service.

Notes: Please review and suggest the naming of the command, handler and end point.

@kmurudi kmurudi changed the title Cns debug http rest service contexts [CNS] Debug - Expose In-memory data from HTTPRestService Mar 19, 2021
@codecov
Copy link

codecov bot commented Mar 19, 2021

Codecov Report

Merging #825 (9aa3781) into master (cf7d8a5) will increase coverage by 0.02%.
The diff coverage is 52.17%.

@@            Coverage Diff             @@
##           master     #825      +/-   ##
==========================================
+ Coverage   42.10%   42.13%   +0.02%     
==========================================
  Files         158      158              
  Lines       15025    15089      +64     
==========================================
+ Hits         6327     6358      +31     
- Misses       7926     7954      +28     
- Partials      772      777       +5     

Copy link
Contributor

@ramiro-gamarra ramiro-gamarra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments

@kmurudi kmurudi force-pushed the CNS_Debug_HTTPRestService_Contexts branch 7 times, most recently from 8b8f623 to 6652dba Compare March 25, 2021 19:23
@kmurudi kmurudi requested a review from ramiro-gamarra March 25, 2021 19:23
@kmurudi kmurudi force-pushed the CNS_Debug_HTTPRestService_Contexts branch from 6652dba to da5071c Compare March 25, 2021 19:46
ramiro-gamarra
ramiro-gamarra previously approved these changes Mar 26, 2021
Copy link
Contributor

@ramiro-gamarra ramiro-gamarra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine to merge, but let's discuss the comments left first.

pm.mu.Lock()

return cns.IpamPoolMonitorStateSnapshot {
MinimumFreeIps: pm.MinimumFreeIps,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also return

cachedNNC nnc.NodeNetworkConfig
updatingIpsNotInUseCount int

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neaggarwMS yes I have added them too to IPAMPoolMonitor in the latest commit, please review if that looks good and the CLI command/end-point we should name for this debug API.

Copy link
Member

@neaggarwMS neaggarwMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

@kmurudi kmurudi force-pushed the CNS_Debug_HTTPRestService_Contexts branch from c8bb282 to 3425da9 Compare March 30, 2021 05:28
@kmurudi kmurudi requested a review from neaggarwMS March 30, 2021 16:53
neaggarwMS
neaggarwMS previously approved these changes Apr 6, 2021
Copy link
Member

@neaggarwMS neaggarwMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

kmurudi added 2 commits April 6, 2021 23:23
This commit has following changes -
1. Removed AllocatedIPCount field from HTTPRestService
struct in restserver.go as it is not used in project.
2. Added debug command getInMemory and API to expose
fields-HTTPRestService and 2 fields from IPAMPoolMonitor.
Please review the naming of the command, handler and end
point.
3. Added Test function to test the new api response.
4. Added changes as per review comments - Get request
for Test endpoint.
@kmurudi kmurudi force-pushed the CNS_Debug_HTTPRestService_Contexts branch from 3425da9 to a53848e Compare April 7, 2021 07:23
desiredIpAddress := "10.0.0.5"

secondaryIps := make([]string, 0)
secondaryIps = append(secondaryIps, desiredIpAddress)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can just

secondaryIps := []string{desiredIpAddress}

ramiro-gamarra
ramiro-gamarra previously approved these changes Apr 7, 2021
In-memory data API - adding 2 more fields to IPAMPoolMonitor
@kmurudi kmurudi force-pushed the CNS_Debug_HTTPRestService_Contexts branch from a53848e to 9aa3781 Compare April 7, 2021 18:26
@kmurudi kmurudi requested a review from ramiro-gamarra April 7, 2021 18:26
@kmurudi kmurudi merged commit 1d3b30b into Azure:master Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants