Fix grub2_audit_argument#14631
Conversation
|
Hi @alanmcanonical. 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 Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain 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. |
…B_CMDLINE_LINUX Signed-off-by: Alan Moore <alan.moore@canonical.com>
shared/macros/10-bash.jinja
Outdated
| else | ||
| echo "GRUB_CMDLINE_LINUX=\"{{{ arg_name_value }}}\"" >> '/etc/default/grub' | ||
| fi | ||
| for grub_var in {{{ grub_vars }}}; do |
There was a problem hiding this comment.
The CI fail seems to be legit:
In /__w/content/content/build/ol7/fixes/bash/grub2_audit_argument.sh line 16:
for grub_var in GRUB_CMDLINE_LINUX; do
^----------------^ SC2043 (warning): This loop will only ever run once. Bad quoting or missing glob/expansion?
I suggest fixing this by replacing the Bash for loop by a Jinja for loop. That way the code on Ubuntu will unroll to two code blocks and on other products it will unroll to a single code block, which hopefully will satisfy shellcheck.
{{%- for grub_var in grub_vars %}}
Signed-off-by: Alan Moore <alan.moore@canonical.com>
jan-cerny
left a comment
There was a problem hiding this comment.
I have run the tests locally on RHEL 9 and they passed for both Ansible and Bash
Description:
Rationale: