-
Notifications
You must be signed in to change notification settings - Fork 687
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
"<" operator in jq filter fails the build #11922
Comments
Hi, could you tell us how have you tried to escape the Regardless, there is another approach that you can take Instead of using the I have not tested, but the following may work:
For more info about the template's capability, check https://complianceascode.readthedocs.io/en/latest/templates/template_reference.html#yamlfile-value |
I think I tried these options Thanks for the suggestion. The problem is that I am also checking for another key and only if both statements are true the check is compliant. This is my full jqfilter: |
@ermeratos You might want to separate the two checks into their own rules; or, Did the xml escaping suggestion work for you? |
I wanted to prevent the two checks from being separated. Thank you for the tip about the platform check, I might try that out. I completely missed your info about the XML escape, otherwise I could have tested it earlier. Because it actually works with |
Description of problem:
I tried to use the less-than-operator "<" in jq filter which should be supported according to https://jqlang.github.io/jq/
Everytime I try to run a cluster-test with using the corresponding rule the build fails:
Using other comparison operators work as expected.
The issue could be because of the conversion to XML and interpreting "<" as XML syntax.
I tried escaping the character without success.
SCAP Security Guide Version:
0.1.73
Operating System Version:
RHEL 9.3
Steps to Reproduce:
The rule I tried to create is specific to the kube descheduler operator so I'll describe how to reproduce for this specific issue.
Create a cluster role and rolebinding for the compliance operator to have permissions for openshift-kube-descheduler-operator:kubedeschedulers
Write rule as follows:
./utils/add_kubernetes_rule.py cluster-test --rule kube_descheduler_lifecycle_policy --skip-deploy
Actual Results:
Build fails
Expected Results:
Build and cluster-test finishes
Additional Information/Debugging Steps:
The issue can probably be reproduced not only with the kube-descheduler operator as long as the "<"-operator is used in the jqfilter.
The text was updated successfully, but these errors were encountered: