Skip to content

Commit

Permalink
OCPBUGS-1316: Add missing variable reference to rules
Browse files Browse the repository at this point in the history
Some of the kubeletconfig rules does not have not contains reference to variable being used in its remediation, this PR adds that reference to those rules. Related BUG: https://issues.redhat.com/browse/OCPBUGS-1316
  • Loading branch information
Vincent056 committed May 23, 2024
1 parent ef725b1 commit 96eab7e
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='') -%}}
Remediations for the {{{ field_name }}} field will be set to {{ .{{{ variable_name }}} }} based on variable {{{ variable_name }}}.
{{%- endmacro -%}}


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

0 comments on commit 96eab7e

Please sign in to comment.