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

perf: check validity before constructing a new set of requirements #2011

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

tzneal
Copy link
Contributor

@tzneal tzneal commented Feb 19, 2025

Description
When checking if a Pod will work on an existing Node, we validate in several ways including
checking the Pods requirements vs the Node's requirements. If it fails at any step,
we need to leave the Node's requirements unchanged. Previously we were:

  1. Creating set of temporary requirements from the current node's requirements
  2. Check if the Pod is compatible with them
  3. Assigning those back to the Node if all compatibility checks passed

This changes the order so that we check for compatibility with the Pod first so that
in the case of a Pod not being compatible, we can avoid the allocation that occurs when
creating the temporary set of requirements.

How was this change tested?

Unit testing & deployed

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 19, 2025
@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 Feb 19, 2025
@tzneal tzneal changed the title check validity before constructing a new set of requirements perf: check validity before constructing a new set of requirements Feb 19, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 13420882534

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 7 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.05%) to 81.429%

Files with Coverage Reduction New Missed Lines %
pkg/controllers/provisioning/scheduling/nodeclaim.go 3 86.98%
pkg/controllers/disruption/consolidation.go 4 88.55%
Totals Coverage Status
Change from base Build 13378807880: -0.05%
Covered Lines: 9243
Relevant Lines: 11351

💛 - Coveralls

Copy link
Member

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 19, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jonathan-innis, tzneal

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:
  • OWNERS [jonathan-innis,tzneal]

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 merged commit 22eb374 into main Feb 19, 2025
13 checks passed
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

4 participants