centralize remove node defaults (#13004)

This commit is contained in:
Srishti Jaiswal
2026-02-14 02:42:00 +05:30
committed by GitHub
parent 6b8911ca60
commit e76eecc442
2 changed files with 6 additions and 6 deletions

View File

@@ -16,11 +16,11 @@
--ignore-daemonsets
--grace-period {{ drain_grace_period }}
--timeout {{ drain_timeout }}
--delete-emptydir-data {{ kube_override_hostname | default(inventory_hostname) }}
--delete-emptydir-data {{ kube_override_hostname }}
when:
- groups['kube_control_plane'] | length > 0
# ignore servers that are not nodes
- kube_override_hostname | default(inventory_hostname) in nodes.stdout_lines
- kube_override_hostname in nodes.stdout_lines
register: result
failed_when: result.rc != 0 and not allow_ungraceful_removal
delegate_to: "{{ groups['kube_control_plane'] | first }}"
@@ -34,10 +34,10 @@
register: nodes_with_volumes
delegate_to: "{{ groups['kube_control_plane'] | first }}"
changed_when: false
until: not (kube_override_hostname | default(inventory_hostname) in nodes_with_volumes.stdout_lines)
until: not (kube_override_hostname in nodes_with_volumes.stdout_lines)
retries: 3
delay: "{{ drain_grace_period }}"
when:
- groups['kube_control_plane'] | length > 0
- not allow_ungraceful_removal
- kube_override_hostname | default(inventory_hostname) in nodes.stdout_lines
- kube_override_hostname in nodes.stdout_lines