Skip to content

Commit

Permalink
Merge pull request #12012 from Vincent056/variable_ref
Browse files Browse the repository at this point in the history
OCPBUGS-1316: Add missing variable reference to rules
  • Loading branch information
yuumasato authored Jun 11, 2024
2 parents 1c83564 + 4c5266f commit c8eb752
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 0 deletions.
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

0 comments on commit c8eb752

Please sign in to comment.