OCPBUGS-93785: fix(cpo): initialize nil resource requests map before applying overrides#8924
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@hypershift-jira-solve-ci[bot]: This pull request references Jira Issue OCPBUGS-93785, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (jiezhao@redhat.com), skipping review request. The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@hypershift-jira-solve-ci[bot]: This pull request references Jira Issue OCPBUGS-93785, which is valid. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (jiezhao@redhat.com), skipping review request. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
Estimated code review effort: Medium Suggested labels: bug, controlplane-component, needs-test Suggested reviewers: (based on typical file ownership in this repository) Poem: 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8924 +/- ##
==========================================
+ Coverage 43.28% 43.34% +0.06%
==========================================
Files 771 771
Lines 95506 95538 +32
==========================================
+ Hits 41335 41412 +77
+ Misses 51287 51242 -45
Partials 2884 2884
... and 7 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
| aroSwiftNICResource: resource.MustParse("1"), | ||
| }, | ||
| }, | ||
| }, |
There was a problem hiding this comment.
add another test case for mixing container/init-container and nil/non-nil resources
There was a problem hiding this comment.
Done. Added a test case that overrides across both containers and init-containers, mixing nil and non-nil resource requests in the same pod template spec.
AI-assisted response via Claude Code
|
/test address-review-comments |
|
Review agent triggered. View job |
The applyRequestsOverrides function panics with "assignment to entry in nil map" when a resource-request-override annotation targets a container that has no existing Resources.Requests map. This adds a nil guard to initialize the map before calling maps.Copy, matching the pattern already used for Resources.Limits in applyNonOvercommitableResourceLimits. Signed-off-by: OpenShift CI Bot <ci-bot@redhat.com>
d35c068 to
cce5775
Compare
|
@hypershift-jira-solve-ci[bot]: This pull request references Jira Issue OCPBUGS-93785, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (jiezhao@redhat.com), skipping review request. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/approve |
|
Scheduling tests matching the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: enxebre, hypershift-jira-solve-ci[bot] 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 |
Test Resultse2e-aws
Failed TestsTotal failed tests: 2
e2e-aks
|
|
@hypershift-jira-solve-ci[bot]: The following tests failed, say
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. |
What this PR does / why we need it:
The
applyRequestsOverridesfunction panics with "assignment to entry in nil map" when a resource-request-override annotation targets a container that has no existingResources.Requestsmap. This adds a nil guard to initialize the map before callingmaps.Copy, matching the pattern already used forResources.LimitsinapplyNonOvercommitableResourceLimits.Which issue(s) this PR fixes:
Fixes https://redhat.atlassian.net/browse/OCPBUGS-93785
Special notes for your reviewer:
The fix follows the same nil-guard pattern already used for
Resources.LimitsinapplyNonOvercommitableResourceLimitswithin the same file.Checklist:
Always review AI generated responses prior to use.
Generated with Claude Code via openshift-developer plugin
Summary by CodeRabbit