fix(metallb): wire metallb_controller_tolerations into controller Dep… (#13384)

* fix(metallb): wire metallb_controller_tolerations into controller Deployment

The metallb_controller_tolerations default was introduced in #7334 along
with template wiring, but the wiring was lost in #9120 when the manifest
was regenerated for the CRD switch. Since then the variable has been
defined in roles/kubernetes-apps/metallb/defaults/main.yml but silently
ignored: only metallb_config.controller.tolerations reached the
controller Deployment, while the speaker DaemonSet still honors both
metallb_speaker_tolerations and its metallb_config override.

Merge the role default with the optional metallb_config override, and
only emit the tolerations key when the merged list is non-empty, so
current rendering is unchanged for users who set neither variable.

Signed-off-by: vexsx <p.gheiratian1382@yahoo.com>

* Update metallb.yaml.j2

simplify metallb_controller_tolerations merge using default([])

---------

Signed-off-by: vexsx <p.gheiratian1382@yahoo.com>
This commit is contained in:
Parsa Gheiratian
2026-10-26 15:46:11 +00:00
committed by GitHub
parent 27281bf330
commit a296c6a239
@@ -1752,9 +1752,9 @@ spec:
- mountPath: /tmp/k8s-webhook-server/serving-certs - mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert name: cert
readOnly: true readOnly: true
{% if metallb_config.controller is defined and metallb_config.controller.tolerations is defined %} {% set controller_tolerations = metallb_controller_tolerations + (metallb_config.controller.tolerations | default([])) %}{% if controller_tolerations %}
tolerations: tolerations:
{{ metallb_config.controller.tolerations | to_nice_yaml(indent=2) | indent(width=8) }} {{ controller_tolerations | to_nice_yaml(indent=2) | indent(width=8) }}
{%- endif %} {%- endif %}
nodeSelector: nodeSelector:
{{ metallb_controller_nodeselector | to_nice_yaml | indent(width=8) -}} {{ metallb_controller_nodeselector | to_nice_yaml | indent(width=8) -}}