RFE-9580: Add scanRequests field to ScanSetting CRD for configurable resource requests - #1314
Conversation
…equests This adds a new `scanRequests` field to the ComplianceScanSettings struct, allowing users to configure resource requests for scan pods via the ScanSetting CRD. The field functions identically to the existing `scanLimits` but applies to container resource requests rather than limits. By default, the operator uses sensible defaults (50Mi memory, 10m CPU for the scanner container and 20Mi memory, 10m CPU for the api-resource-collector container). The new field allows overriding these defaults. Changes: - Add ScanRequests field to ComplianceScanSettings (compliancescan_types.go) - Add scanRequests() helper function mirroring scanLimits() (scan.go) - Apply scanRequests to all scanner containers (OpenSCAP, CEL, collector) - Update deepcopy generated code (zz_generated.deepcopy.go) - Update all CRD manifests (config/crd, config/helm, bundle) - Add CheckPodRequest e2e test helper (framework/common.go) - Add TestScannerAndAPICollectorRequestsConfigurable e2e test Resolves: RFE-9580 Co-authored-by: Cursor <cursoragent@cursor.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Chauguleshubhada The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @Chauguleshubhada. Thanks for your PR. I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
|
@Chauguleshubhada: This pull request references RFE-9580 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the feature request to target the "5.0.0" version, but no target version was set. 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. |
Summary
scanRequestsfield toComplianceScanSettingsstruct, allowing users to configure resource requests for scan pods via the ScanSetting CRDscanLimitsbut applies to container resource requests rather than limitsMotivation
Currently, only resource limits can be configured via
scanLimits. Resource requests are hardcoded (50Mi/10m for scanner, 20Mi/10m for api-resource-collector). Customers need to configure requests to ensure proper pod scheduling across all cluster nodes.Resolves: RFE-9580
Changes
compliancescan_types.goScanRequestsfield toComplianceScanSettingszz_generated.deepcopy.goscan.goscanRequests()helper; applied to all scanner containersscanRequestsschema to ScanSetting, ComplianceScan, ComplianceSuite CRDsframework/common.go,scan-config/main_test.goCheckPodRequesthelper andTestScannerAndAPICollectorRequestsConfigurableUsage Example
Test Plan
go build ./...compiles cleanlymake manifests generateregenerates CRDs matching committed YAMLTestScannerAndAPICollectorRequestsConfigurablepassesscanRequestspropagates correctly to scanner pod specsscanRequests) is unchanged (backward compatible)