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

Include IP assigmenets when reconciling VIP ips #354

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

cprivitere
Copy link
Member

on CPEM clusters.

Signed-off-by: Chris Privitere 23177737+cprivitere@users.noreply.github.com

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

on CPEM clusters.

Signed-off-by: Chris Privitere <23177737+cprivitere@users.noreply.github.com>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 13, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cprivitere

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 13, 2022
@cprivitere cprivitere merged commit 9d5c0e0 into main Jul 13, 2022
@cprivitere cprivitere deleted the include-ip-assignments branch July 13, 2022 22:54
@cprivitere cprivitere added this to the 0.6.0 milestone Jul 15, 2022
@displague
Copy link
Member

displague commented Nov 2, 2022

This change increased the response time and size for IP address lists fetched from the EM API. 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. 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

@displague
Copy link
Member

displague commented Nov 2, 2022

IIRC, this PR was made to ensure that the assignments would continue to be included in the event that they became optional in the future. Including the Assignments and AssignedTo fields is a pattern copied from the web console.

Defensive coding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants