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

Refactor Pool-manager tests #448

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

RamLavi
Copy link
Member

@RamLavi RamLavi commented Dec 31, 2024

What this PR does / why we need it:
This PR does refactor chores on the pool-manager library:

  • Give meaningful names to const MACs
  • Use multus consts
  • Move closure functions to regular functions
  • Add check for macpool deleted MACs

Special notes for your reviewer:

Release note:

NONE

@kubevirt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from ramlavi. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

The networks and network-status annotations consts are set on multus
repo, and controlled by it. Using their consts to keep consistency.
For example, the deprecated 'k8s.v1.cni.cncf.io/networks-status'
annotation is replaced by the new one 'k8s.v1.cni.cncf.io/network-status'

Signed-off-by: Ram Lavi <[email protected]>
There is no good reason to use these functions as closure functions.
Moving them to be regular functions, thus reducing code complexity.

Signed-off-by: Ram Lavi <[email protected]>
Currently not all unit tests check macpool size after doing changes in
the macpool map (allocate, update or delete MACs entries)
Moving the check inside checkMacPoolMapEntries so that all tests check
this, removing the now redundant checks.
Also refactoring use of "errors.New(fmt.Sprintf(...))" into
"fmt.Errorf(...)"

Signed-off-by: Ram Lavi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants