-
Notifications
You must be signed in to change notification settings - Fork 724
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
[OCPBUGS-42396]Add variable reference for resource_requests_limits rules #12987
base: master
Are you sure you want to change the base?
[OCPBUGS-42396]Add variable reference for resource_requests_limits rules #12987
Conversation
0d3d2e8
to
3fce1c1
Compare
@xiaojiey Please fill in the PR description. |
dbc3c5c
to
3de9255
Compare
5359ffa
to
e18afde
Compare
Verification passed with 4.18.0-0.nightly-2025-02-19-132725 + compliance-operator from https://github.com/ComplianceAsCode/compliance-operator + PR #12987 code
|
/hold |
e18afde
to
9149934
Compare
9149934
to
00821b0
Compare
@xiaojiey: The following tests failed, say
Full PR test history. Your PR dashboard. 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 kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Code Climate has analyzed commit 00821b0 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 62.1% (0.0% change). View more on Code Climate. |
There are two locations in the operator code requiring fixes in order to address this bug:
At line 998, the existing implementation is not correctly appending all necessary text for parsing values. This function should be updated to the following: func listNodeFields(node parse.Node, res []string) []string {
if node.Type() != parse.NodeNil {
res = append(res, node.String())
}
if ln, ok := node.(*parse.ListNode); ok {
for _, n := range ln.Nodes {
res = listNodeFields(n, res)
}
}
return res
}
The logic at this location in the same file needs to be updated so we will return a list of rendered values like https://github.com/ComplianceAsCode/compliance-operator/blob/adbd9f10adcd52c7f3d516b4705aff9b3bb86d75/pkg/profileparser/profileparser.go#L649C1-L650C1 No changes are required for the profile part; only the parsing logic needs to be adjusted as described above. |
# todo : better if we can keep openshift document link for this reference, | ||
<p> | ||
To configure resource requests/limits for a deployement, follow the directions in | ||
{{{ weblink(link="https://docs.openshift.com/container-platform/latest/applications/deployments/managing-deployment-processes.html#deployments-setting-resources_deployment-operations", |
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.
This will redirect to https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/building_applications/deployments#deployments-setting-resources_deployment-operations now - we could update it here to use docs.redhat.com so we don't have to later.
Description:
Add variable reference for resource_requests_limits_in_daemonset, resource_requests_limits_in_deployment and resource_requests_limits_in_statefuleset rules.