Skip to content
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

IP Address Assignments and AssignedTo fields are unused response bloat #464

Closed
displague opened this issue Nov 2, 2022 · 0 comments · Fixed by #465
Closed

IP Address Assignments and AssignedTo fields are unused response bloat #464

displague opened this issue Nov 2, 2022 · 0 comments · Fixed by #465

Comments

@displague
Copy link
Member

In #354, a change in EM API include fields to add details about the IP Addresses resulted in a large increase in the response time and size for IP address list responses for large projects.

We'll want to revert this.

In CAPP, the resulting Assignments field in the IP address lists is only used in len() calls to determine if an address is in use.

if len(controlPlaneEndpoint.Assignments) == 0 {
a := corev1.NodeAddress{
Type: corev1.NodeExternalIP,
Address: controlPlaneEndpoint.Address,
}

It appears that assignments and assignments.assigned_to includes are not necessary for this purpose. Countable href objects are returned in an assignments list without explicit includes.

We see further proof of this when comparing metal-cli commands (debug output reveals that metal-cli nor packngo are adding unsolicited include values):

$ metal ips get -o json | jq '.[].assignments|length'  | sort -n | uniq -c 
     29 0
      1 1
      2 3
$ metal ips get -o json --include assignments,assignments.assigned_to | jq '.[].assignments|length'  | sort -n | uniq -c 
     29 0
      1 1
      2 3

Originally posted by @displague in #354 (comment)

@displague displague changed the title This change increased the response time and size for IP address lists fetched from the EM API. We'll want to revert this. IP Address Assignments and AssignedTo fields are unused response bloat Nov 2, 2022
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 a pull request may close this issue.

1 participant