Skip to content

Commit

Permalink
control-plane: refactor group membership test
Browse files Browse the repository at this point in the history
Testing with group_names does not require the groups to exist.
  • Loading branch information
VannTen committed Sep 23, 2024
1 parent bd46e97 commit a17c41f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ nodeRegistration:
{% if kube_override_hostname | default('') %}
name: "{{ kube_override_hostname }}"
{% endif %}
{% if inventory_hostname in groups['kube_control_plane'] and inventory_hostname not in groups['kube_node'] %}
{% if 'kube_control_plane' in group_names and 'kube_node' not in group_names %}
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ controlPlane:
nodeRegistration:
name: {{ kube_override_hostname | default(inventory_hostname) }}
criSocket: {{ cri_socket }}
{% if inventory_hostname in groups['kube_control_plane'] and inventory_hostname not in groups['kube_node'] %}
{% if 'kube_control_plane' in group_names and 'kube_node' not in group_names %}
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
Expand Down

0 comments on commit a17c41f

Please sign in to comment.