-
Notifications
You must be signed in to change notification settings - Fork 5
fix(vm): propagate PV nodeAffinity to VM pod for correct scheduling #2127
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
Merged
Merged
Changes from all commits
Commits
Show all changes
85 commits
Select commit
Hold shift + click to select a range
7c4df85
wip
loktev-d f5099bd
Merge remote-tracking branch 'origin/main' into feat/vm/hotplug-block…
loktev-d ddf6e44
wip
loktev-d ccbe3a4
wip
loktev-d b46c4ab
wip
loktev-d a04c63e
wip
loktev-d 331ba6a
wip
loktev-d eb51b47
wip
loktev-d 6312d9f
fix linter errors
loktev-d 6c6d5e6
Merge branch 'main' into feat/vm/hotplug-block-devices-via-spec
loktev-d bebae37
move attachment service back
loktev-d 2b40420
wip
loktev-d 1a9ea6f
wip
loktev-d 625783e
Merge branch 'main' into feat/vm/hotplug-block-devices-via-spec
loktev-d 9f0b015
wip
loktev-d ababbb2
wip
loktev-d fab1cb0
add e2e
loktev-d 3f9bbe1
add unit tests
loktev-d 9fa1597
add doc
loktev-d e4d602e
wip
loktev-d d015889
fix vmbda error
loktev-d a8fc9cf
add validation for conflicts
loktev-d 1843d0e
docs: review
prismagod 7e25cbc
Merge remote-tracking branch 'origin/main' into feat/vm/hotplug-block…
loktev-d 417b093
fix merge
loktev-d 69e74ad
Merge remote-tracking branch 'origin/main' into feat/vm/hotplug-block…
loktev-d 8e9a8a1
docs: update user guide for block device attachment methods
prismagod ace7f4c
docs: fix
prismagod a29e584
docs: add additional info from ADR
prismagod bfc9a1b
docs: post-review updates
prismagod de41a9a
fix backward compatility
loktev-d 6ce1e96
fix comments
loktev-d f9ec5d8
wip
loktev-d 3823407
fix: golangci-lint error
4861047
docs: update bootOrder description
prismagod 981aa64
fix: vi on pvc is not ephemeral
d461779
feat: add bootOrder to vm block device refs status
919e4e7
chore: refactor bootOrder status
4d87095
chore: refactor bootOrderStatus 2
e4c33e7
wip
loktev-d f6ce136
add tests
loktev-d a9f6c87
wip
loktev-d 4a79c41
wip
loktev-d b3603fe
Revert "wip"
loktev-d 97c9376
wip
loktev-d 4028c4c
wip
loktev-d 193316a
fix linter errors
loktev-d 494a45f
wip
loktev-d cf571b3
Merge branch 'main' into feat/vm/hotplug-block-devices-via-spec
loktev-d b317327
Merge branch 'feat/vm/hotplug-block-devices-via-spec' into fix/vm/pv-…
loktev-d 31cd2d7
fix logic for disk buses
loktev-d 98362b1
Merge branch 'main' into feat/vm/hotplug-block-devices-via-spec
loktev-d e7d2151
wip
loktev-d a10a634
fix linter errors
loktev-d ee73fce
wip
loktev-d 615087f
Merge branch 'main' into feat/vm/hotplug-block-devices-via-spec
loktev-d f809e17
wip
loktev-d 0940704
wip
loktev-d 151cea8
wip
loktev-d 3426283
update docs
loktev-d ae66847
update docs
loktev-d e0c378d
update docs
loktev-d 2efb5fd
Merge branch 'feat/vm/hotplug-block-devices-via-spec' into fix/vm/pv-…
loktev-d e31e2af
docs: update user guide on disk hotplug and paravirtualization
prismagod ee8e0e3
docs: fix user guide
prismagod 5e9f7b5
Merge branch 'main' into feat/vm/hotplug-block-devices-via-spec
loktev-d 2ec90ef
Merge branch 'feat/vm/hotplug-block-devices-via-spec' into fix/vm/pv-…
loktev-d 53028f6
fix comments
loktev-d 22c1437
fix comments
loktev-d 09237f4
wip
loktev-d e7f22ba
wip
loktev-d 941395e
Merge branch 'main' into feat/vm/hotplug-block-devices-via-spec
loktev-d 8317c2f
Merge branch 'feat/vm/hotplug-block-devices-via-spec' into fix/vm/pv-…
loktev-d d2c413a
wip
loktev-d 8c11288
Merge branch 'feat/vm/hotplug-block-devices-via-spec' into fix/vm/pv-…
loktev-d 948a723
wip
loktev-d 9569ab2
wip
loktev-d 3ec1de2
wip
loktev-d 1dc565c
Merge branch 'main' into feat/vm/hotplug-block-devices-via-spec
loktev-d e628dba
Merge branch 'feat/vm/hotplug-block-devices-via-spec' into fix/vm/pv-…
loktev-d c82a573
remove fromCacheVersion
loktev-d 330bf14
wip
loktev-d 2b637e7
add label for e2e test
loktev-d 90dcffe
Merge branch 'feat/vm/hotplug-block-devices-via-spec' into fix/vm/pv-…
loktev-d 5937928
Merge branch 'main' into fix/vm/pv-node-affinity-scheduling
loktev-d File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
images/virtualization-artifact/pkg/common/nodeaffinity/nodeaffinity.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| /* | ||
| Copyright 2026 Flant JSC | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| package nodeaffinity | ||
|
|
||
| import corev1 "k8s.io/api/core/v1" | ||
|
|
||
| func IntersectTerms(perPVTerms [][]corev1.NodeSelectorTerm) []corev1.NodeSelectorTerm { | ||
| if len(perPVTerms) == 0 { | ||
| return nil | ||
| } | ||
| result := perPVTerms[0] | ||
| for i := 1; i < len(perPVTerms); i++ { | ||
| result = CrossProductTerms(result, perPVTerms[i]) | ||
| } | ||
| return result | ||
| } | ||
|
|
||
| func CrossProductTerms(a, b []corev1.NodeSelectorTerm) []corev1.NodeSelectorTerm { | ||
| var result []corev1.NodeSelectorTerm | ||
| for _, termA := range a { | ||
| for _, termB := range b { | ||
| merged := corev1.NodeSelectorTerm{ | ||
| MatchExpressions: append( | ||
| append([]corev1.NodeSelectorRequirement{}, termA.MatchExpressions...), | ||
| termB.MatchExpressions..., | ||
| ), | ||
| } | ||
| if len(termA.MatchFields) > 0 || len(termB.MatchFields) > 0 { | ||
| merged.MatchFields = append( | ||
| append([]corev1.NodeSelectorRequirement{}, termA.MatchFields...), | ||
| termB.MatchFields..., | ||
| ) | ||
| } | ||
| result = append(result, merged) | ||
| } | ||
| } | ||
| return result | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.