Skip to content

Commit

Permalink
fix tolerations invalid YAML if undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
pli01 committed Apr 20, 2023
1 parent d2a744e commit ec8df4e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ spec:
volumes:
- name: tmp
emptyDir: {}
{% if not masters_are_not_tainted or metrics_server_extra_tolerations is defined %}
tolerations:
{% if not masters_are_not_tainted %}
- key: node-role.kubernetes.io/master
Expand All @@ -93,6 +94,7 @@ spec:
{% endif %}
{% if metrics_server_extra_tolerations is defined %}
{{ metrics_server_extra_tolerations | list | to_nice_yaml(indent=2) | indent(8) }}
{% endif %}
{% endif %}
affinity:
podAntiAffinity:
Expand All @@ -111,7 +113,7 @@ spec:
{% if metrics_server_extra_affinity is defined %}
{{ metrics_server_extra_affinity | to_nice_yaml | indent(width=8) }}
{% endif %}
{% if metrics_server_nodeselector %}
{% if metrics_server_nodeselector is defined %}
nodeSelector:
{{ metrics_server_nodeselector | to_nice_yaml | indent(width=8) }}
{% endif %}

0 comments on commit ec8df4e

Please sign in to comment.