-
Notifications
You must be signed in to change notification settings - Fork 51
Add AWS CPUOptions to conversion #438
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
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
📝 WalkthroughWalkthroughAdds bidirectional conversion for AWS CPUOptions between CAPA and MAPI, wiring converters into provider spec construction and AWSMachineSpec assembly. Fuzz tests expanded to exercise CPUOptions and ConfidentialComputePolicy values and to normalize empty CPUOptions during fuzzing. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to data retention organization setting 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧬 Code graph analysis (1)pkg/conversion/mapi2capi/aws_fuzz_test.go (1)
🔇 Additional comments (7)
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pkg/conversion/mapi2capi/aws_fuzz_test.go (1)
173-188: Consider makingfuzzAWSMachineSpecCPUOptionsa standalone function for consistency.The method
fuzzAWSMachineSpecCPUOptionsdoesn't use the receiverf, butfuzzAWSMachineSpecConfidentialComputePolicyis already a standalone function. Consider making both consistent.🔎 Proposed refactor
-func (f *awsProviderFuzzer) fuzzAWSMachineSpecCPUOptions(cpuOpts *mapiv1beta1.CPUOptions, c randfill.Continue) { +func fuzzAWSMachineSpecCPUOptions(cpuOpts *mapiv1beta1.CPUOptions, c randfill.Continue) { c.FillNoCustom(cpuOpts) if cpuOpts.ConfidentialCompute != nil { fuzzAWSMachineSpecConfidentialComputePolicy(cpuOpts.ConfidentialCompute, c) } }And update the reference at line 285:
f.fuzzProviderConfig, - f.fuzzAWSMachineSpecCPUOptions, + fuzzAWSMachineSpecCPUOptions, }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (4)
pkg/conversion/capi2mapi/aws.gopkg/conversion/capi2mapi/aws_fuzz_test.gopkg/conversion/mapi2capi/aws.gopkg/conversion/mapi2capi/aws_fuzz_test.go
🧰 Additional context used
🧬 Code graph analysis (1)
pkg/conversion/mapi2capi/aws_fuzz_test.go (1)
pkg/conversion/test/fuzz/fuzz.go (1)
MAPIMachineFuzzer(631-635)
🔇 Additional comments (4)
pkg/conversion/capi2mapi/aws_fuzz_test.go (1)
210-225: LGTM - CPUOptions fuzzing logic is correct.The fuzzer properly covers the valid
ConfidentialComputepolicy values including the empty string case, which aligns with the conversion functionConvertAWSCPUOptionsToMAPIthat returnsnilwhen CPUOptions is empty.pkg/conversion/mapi2capi/aws.go (1)
726-743: LGTM - MAPI to CAPI CPUOptions conversion is well-structured.The function correctly handles nil input and maps the known
ConfidentialComputepolicy values. Unknown or empty values result in an emptyCPUOptions, which is the expected default behavior.pkg/conversion/mapi2capi/aws_fuzz_test.go (1)
163-165: LGTM - Proper normalization of empty CPUOptions.The normalization ensures that a non-nil pointer to an empty
CPUOptionsstruct is converted tonil, which is necessary for round-trip conversion consistency since the CAPA side returns an empty struct that gets normalized.pkg/conversion/capi2mapi/aws.go (1)
691-707: LGTM - CAPI to MAPI CPUOptions conversion is correct.The function properly handles the bidirectional conversion:
- Maps known
ConfidentialComputepolicy values (Disabled, SEVSNP)- Returns
nilwhen the resultingCPUOptionswould be empty, ensuring clean serialization- Unknown or empty CAPA values result in
nilMAPI CPUOptions, which is the expected behavior
|
Thanks @fangge1212 will need rebasing :) |
damdo
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
/lgtm
/assign @theobarberbany
|
Scheduling tests matching the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: damdo 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 |
Signed-off-by: Fangge Jin <fjin@redhat.com>
f587952 to
c382a98
Compare
|
New changes are detected. LGTM label has been removed. |
|
@fangge1212: all tests passed! Full PR test history. Your PR dashboard. 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. |
This PR adds AWS CPUOptions to conversion, and adds fuzz tests for it.
Summary by CodeRabbit
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.