-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Introduce PreferredArchitecture and Architecture requirements to preferences
#15398
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
Conversation
|
Skipping CI for Draft Pull Request. |
PreferredArchitecture and Architecture requirements to preferencesPreferredArchitecture and Architecture requirements to preferences
36a7860 to
076560d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- Wrap the Architecture requirement check inside the same
Requirements != nilguard in checker.go to avoid dereferencingRequirementswhen it’s nil and causing a panic. - There’s a typo in the field descriptions (
prefeerred); please correct it topreferredfor consistency. - Rather than hand‐editing the generated CRD and client-go OpenAPI files, consider updating the generator definitions and rerunning the codegen so future changes don’t get overwritten.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Wrap the Architecture requirement check inside the same `Requirements != nil` guard in checker.go to avoid dereferencing `Requirements` when it’s nil and causing a panic.
- There’s a typo in the field descriptions (`prefeerred`); please correct it to `preferred` for consistency.
- Rather than hand‐editing the generated CRD and client-go OpenAPI files, consider updating the generator definitions and rerunning the codegen so future changes don’t get overwritten.
## Individual Comments
### Comment 1
<location> `pkg/virt-operator/resource/generate/components/validations_generated.go:9827` </location>
<code_context>
format: int32
type: integer
+ preferredArchitecture:
+ description: PreferredArchitecture defines a prefeerred architecture for
+ the VirtualMachine
+ type: string
</code_context>
<issue_to_address>
Typo in 'prefeerred' in description.
Please update the description to use the correct spelling: 'preferred'.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
description: PreferredArchitecture defines a prefeerred architecture for
the VirtualMachine
=======
description: PreferredArchitecture defines a preferred architecture for
the VirtualMachine
>>>>>>> REPLACE
</suggested_fix>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
ab9118a to
35b7b8e
Compare
|
/hold #15009 |
Signed-off-by: Lee Yarwood <[email protected]>
35b7b8e to
94a0285
Compare
|
Great job! Thanks! |
| } | ||
|
|
||
| preferenceSpec, _ := m.FindPreference(vm) | ||
| mutateArch(vm, preferenceSpec) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should be mutating the VM. Is it not sufficient to apply the architecture when a VMI is created from the VM and preference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@0xFelix Unfortunately we always mutate a default arch into the VM so we have no choice but mutate any preferred values ahead of this to ensure they apply. I'd much rather this wasn't the case and we could just override defaults through a status value but refactoring and changing this behaviour is lots of work and outside the scope of this PR tbh. For now this will have to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, unfortunate but it is what it is.
Signed-off-by: Lee Yarwood <[email protected]>
94a0285 to
19beaa1
Compare
Signed-off-by: Lee Yarwood <[email protected]>
19beaa1 to
402cca3
Compare
0xFelix
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Thanks!
jean-edouard
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
/hold
See in-line comments about formatting/typo. Feel free to unhold.
| //+optional | ||
| PreferSpreadSocketToCoreRatio uint32 `json:"preferSpreadSocketToCoreRatio,omitempty"` | ||
|
|
||
| // PreferredArchitecture defines a prefeerred architecture for the VirtualMachine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo prefeerred
| * | ||
| */ | ||
| package apply |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * | |
| */ | |
| package apply | |
| */ | |
| package apply |
| * | ||
| */ | ||
| package requirements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * | |
| */ | |
| package requirements | |
| */ | |
| package requirements |
| * limitations under the License. | ||
| * | ||
| * Copyright The KubeVirt Authors. | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| */ | |
| */ | |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jean-edouard 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 |
|
Required labels detected, running phase 2 presubmits: |
|
/hold cancel Thanks @jean-edouard I'll clean this up in a follow up PR |
|
/retest-required |
|
@lyarwood: The following tests failed, say
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
/area instancetype
What this PR does
Preferences are now able to express both preferred and required architecture values for VirtualMachines.
References
Why we need it and why it was done in this way
The following tradeoffs were made:
The following alternatives were considered:
Links to places where the discussion took place:
Special notes for your reviewer
Depends on #15009 as we will also need to handle the defaulting in the mutation webhook.
Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
Release note