From 9d3888a756c3dbbec449c11161ce1ab1422f8fc6 Mon Sep 17 00:00:00 2001 From: Calvin Park Date: Mon, 30 Aug 2021 10:56:09 -0700 Subject: [PATCH] During pre-upgrade add a flag to always cordon (#7892) * During pre-upgrade add a flag to always cordon * empty * empty * empty * Better default val --- roles/upgrade/pre-upgrade/defaults/main.yml | 1 + roles/upgrade/pre-upgrade/tasks/main.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/upgrade/pre-upgrade/defaults/main.yml b/roles/upgrade/pre-upgrade/defaults/main.yml index ddff1ea55..642c4cb81 100644 --- a/roles/upgrade/pre-upgrade/defaults/main.yml +++ b/roles/upgrade/pre-upgrade/defaults/main.yml @@ -6,6 +6,7 @@ drain_nodes: true drain_retries: 3 drain_retry_delay_seconds: 10 +upgrade_node_always_cordon: false upgrade_node_uncordon_after_drain_failure: true upgrade_node_fail_if_drain_fails: true diff --git a/roles/upgrade/pre-upgrade/tasks/main.yml b/roles/upgrade/pre-upgrade/tasks/main.yml index d969175e3..64e01d901 100644 --- a/roles/upgrade/pre-upgrade/tasks/main.yml +++ b/roles/upgrade/pre-upgrade/tasks/main.yml @@ -39,7 +39,7 @@ - name: Set if node needs cordoning set_fact: needs_cordoning: >- - {% if kubectl_node_ready.stdout == "True" and not kubectl_node_schedulable.stdout -%} + {% if (kubectl_node_ready.stdout == "True" and not kubectl_node_schedulable.stdout) or upgrade_node_always_cordon -%} true {%- else -%} false