-
Notifications
You must be signed in to change notification settings - Fork 324
Add HardwareAffinity field to TinkerbellMachineConfig API #10472
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (78.87%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #10472 +/- ##
==========================================
+ Coverage 69.58% 69.63% +0.05%
==========================================
Files 670 670
Lines 40699 40767 +68
==========================================
+ Hits 28320 28389 +69
+ Misses 10668 10667 -1
Partials 1711 1711 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
58cdf3b to
f112e29
Compare
|
Codecov note: Uncovered lines shown (etcd-related in template.go, requirements.Add error paths) are pre-existing gaps appearing in diff context, not new code from this PR. Mocking internal go json to test the error scenario from requirements.Add seems too much and very little gain as happy paths are already covered. New HardwareAffinity validation and selector logic has full test coverage. |
|
/retest-required |
1 similar comment
|
/retest-required |
f112e29 to
2234564
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rajeshvenkata The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This adds a new HardwareAffinity field that provides advanced hardware selection using Kubernetes-style label selectors with required and preferred affinity terms. Key changes: - Add HardwareAffinity, HardwareAffinityTerm, WeightedHardwareAffinityTerm types - Support required terms (OR'd together) and preferred terms (weighted scoring) - Support matchLabels and matchExpressions in label selectors - Add validation for mutual exclusivity with HardwareSelector - Add validation for weight range (1-100) and operator types - Make HardwareSelector and HardwareAffinity mutable (changes affect new machines only) - Update template generation for control plane, worker, and etcd nodes - Update hardware validation assertions and reconciler The HardwareAffinity field is mutually exclusive with the existing HardwareSelector. Both fields are now mutable - changes only affect new machine provisioning as existing machines keep their assigned hardware via CAPT's ownership labels.
2234564 to
3832722
Compare
|
New changes are detected. LGTM label has been removed. |
|
/test eks-anywhere-presubmit |
Issue #, if available:
#9456
https://github.com/aws/eks-anywhere-internal/issues/2712
Description of changes:
Summary
Adds
HardwareAffinityfield toTinkerbellMachineConfigfor advanced hardware selection using Kubernetes-style label selectors with required and preferred terms. This aligns with CAPT's HardwareAffinity feature.Changes
HardwareAffinity,HardwareAffinityTerm, andWeightedHardwareAffinityTermtypesrequired(hard constraints) andpreferred(soft constraints with weights 1-100) affinity termsmatchLabelsandmatchExpressions(In, NotIn, Exists, DoesNotExist operators)HardwareSelectorandHardwareAffinityHardwareSelectorandHardwareAffinityare now mutable - changes only affect new machine provisioning; existing machines keep their assigned hardware (aligns with CAPT's ownership model via labels on Hardware objects)Example
Testing (if applicable):
Unit tests for validation, webhook, and hardware matching
Manual E2E testing: create, scale, K8s upgrade, affinity modification, selector↔affinity switching
Documentation added/planned (if applicable):
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.