Skip to content

Commit

Permalink
Wrap condition in curly braces
Browse files Browse the repository at this point in the history
Wrap condition in curly braces to prevent operator priority problems
when the macro is used as a part of a bigger expression.
  • Loading branch information
jan-cerny committed Feb 10, 2025
1 parent a4d098c commit 9c4e7c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shared/macros/10-bash.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -2669,15 +2669,15 @@ This macro defines a conditional expression that is evaluated as true
if the remediation is performed during a build of a bootable container image.
#}}
{{%- macro bash_bootc_build() -%}}
rpm --quiet -q kernel rpm-ostree bootc && ! rpm --quiet -q openshift-kubelet && { [ -f "/run/.containerenv" ] || [ -f "/.containerenv" ]; }
{ rpm --quiet -q kernel rpm-ostree bootc && ! rpm --quiet -q openshift-kubelet && { [ -f "/run/.containerenv" ] || [ -f "/.containerenv" ]; }; }
{{%- endmacro -%}}

{{#
This macro defines a conditional expression that is evaluated as true
if the remediation is not performed during a build of a bootable container image.
#}}
{{%- macro bash_not_bootc_build() -%}}
! ( {{{ bash_bootc_build() }}} )
! {{{ bash_bootc_build() }}}
{{%- endmacro -%}}


Expand Down

0 comments on commit 9c4e7c0

Please sign in to comment.