Skip to content

Conversation

@tallaxes
Copy link

Fixes #2742

Description

Fixes volume topology scheduling to correctly handle multiple topology terms in PersistentVolumes and StorageClasses.

  • Refactor VolumeTopology.getRequirements() to return NodeSelectorTerm slices instead of flat NodeSelectorRequirement slices to preserve OR semantics across multiple topology terms
  • Update getStorageClassRequirements() to process all allowed topologies, not just the first one
  • Update getPersistentVolumeRequirements() to process all node selector terms, not just the first one
  • Implement proper cartesian product computation of node affinity terms in the Inject() method
  • Add test coverage for multi-term topology scenarios

How was this change tested?

  • Unit tests

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 do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 24, 2025
@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

Details 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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 24, 2025
@coveralls
Copy link

coveralls commented Dec 24, 2025

Pull Request Test Coverage Report for Build 20792216085

Details

  • 49 of 51 (96.08%) changed or added relevant lines in 2 files are covered.
  • 21 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.1%) to 80.379%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/controllers/provisioning/scheduling/volumetopology.go 36 38 94.74%
Files with Coverage Reduction New Missed Lines %
pkg/controllers/provisioning/scheduling/nodeclaim.go 3 89.63%
pkg/controllers/disruption/consolidation.go 4 88.0%
pkg/controllers/provisioning/scheduling/preferences.go 7 88.76%
pkg/controllers/provisioning/scheduling/topologynodefilter.go 7 79.55%
Totals Coverage Status
Change from base Build 20736781005: -0.1%
Covered Lines: 11970
Relevant Lines: 14892

💛 - Coveralls

@tallaxes tallaxes marked this pull request as ready for review December 25, 2025 02:33
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 25, 2025
@tallaxes tallaxes changed the title fix: support multi-zone topology scheduling for persistent volumes (and storage class) fix: support multi-zone topology scheduling for persistent volumes Dec 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scheduling uses only the first term of PersistentVolume nodeAffinity

3 participants