Skip to content
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-1316: Add missing variable reference to rules #12012

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ description: |-
<p>
This rule pertains to the <tt>imagefs.available</tt> setting of the <tt>evictionHard</tt>
section.
{{{ kubernetes_variable_instruction(field_name="imagefs.available", variable_name="var_kubelet_evictionhard_imagefs_available") }}}
</p>


rationale: |-
Garbage collection is important to ensure sufficient resource availability
and avoiding degraded performance and availability. In the worst case, the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ description: |-
<p>
This rule pertains to the <tt>imagefs.inodesFree</tt> setting of the <tt>evictionHard</tt>
section.
{{{ kubernetes_variable_instruction(field_name="imagefs.inodesFree", variable_name="var_kubelet_evictionhard_imagefs_inodesfree") }}}
</p>

rationale: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ description: |-
<p>
This rule pertains to the <tt>memory.available</tt> setting of the <tt>evictionHard</tt>
section.
{{{ kubernetes_variable_instruction(field_name="memory.available", variable_name="var_kubelet_evictionhard_memory_available") }}}
</p>

rationale: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ description: |-
<p>
This rule pertains to the <tt>nodefs.available</tt> setting of the <tt>evictionHard</tt>
section.
{{{ kubernetes_variable_instruction(field_name="nodefs.available", variable_name="var_kubelet_evictionhard_nodefs_available") }}}
</p>

rationale: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ description: |-
<p>
This rule pertains to the <tt>nodefs.inodesFree</tt> setting of the <tt>evictionHard</tt>
section.
{{{ kubernetes_variable_instruction(field_name="nodefs.inodesFree", variable_name="var_kubelet_evictionhard_nodefs_inodesfree") }}}
</p>

rationale: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ description: |-
<p>
This rule pertains to the <tt>imagefs.available</tt> setting of the <tt>evictionSoft</tt>
section.
{{{ kubernetes_variable_instruction(field_name="imagefs.available", variable_name="var_kubelet_evictionsoft_imagefs_available") }}}
</p>

rationale: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ description: |-
<p>
This rule pertains to the <tt>imagefs.inodesFree</tt> setting of the <tt>evictionSoft</tt>
section.
{{{ kubernetes_variable_instruction(field_name="imagefs.inodesFree", variable_name="var_kubelet_evictionsoft_imagefs_inodesfree") }}}
</p>

rationale: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ description: |-
<p>
This rule pertains to the <tt>memory.available</tt> setting of the <tt>evictionSoft</tt>
section.
{{{ kubernetes_variable_instruction(field_name="memory.available", variable_name="var_kubelet_evictionsoft_memory_available") }}}
</p>

rationale: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ description: |-
<p>
This rule pertains to the <tt>nodefs.available</tt> setting of the <tt>evictionSoft</tt>
section.
{{{ kubernetes_variable_instruction(field_name="nodefs.available", variable_name="var_kubelet_evictionsoft_nodefs_available") }}}
</p>

rationale: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ description: |-
<p>
This rule pertains to the <tt>nodefs.inodesFree</tt> setting of the <tt>evictionSoft</tt>
section.
{{{ kubernetes_variable_instruction(field_name="nodefs.inodesFree", variable_name="var_kubelet_evictionsoft_nodefs_inodesfree") }}}
</p>

rationale: |-
Expand Down
4 changes: 4 additions & 0 deletions shared/macros/10-kubernetes.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ spec:
overwrite: true
{{%- endmacro -%}}

{{%- macro kubernetes_variable_instruction(field_name='', variable_name='') -%}}
Remediation will set field {{{ field_name }}} to {{ .{{{ variable_name }}} }} based on the variable {{{ variable_name }}}.
{{%- endmacro -%}}


{{#
Macro which generates Kubernetes remediation in MachineConfig format with
Expand Down
Loading