Browse Source

fix(kubeadm): Conditionally add --skip-phases flag for v1.32.0+ (#12351)

Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
pull/12358/head
ERIK 1 week ago
committed by GitHub
parent
commit
7ead3e2f11
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions
  1. 4
      roles/kubernetes/control-plane/tasks/kubeadm-upgrade.yml

4
roles/kubernetes/control-plane/tasks/kubeadm-upgrade.yml

@ -18,7 +18,9 @@
{%- else %}
--config={{ kube_config_dir }}/kubeadm-config.yaml
{%- endif %}
{%- if kube_version is version('1.32.0', '>=') %}
--skip-phases={{ kubeadm_init_phases_skip | join(',') }}
{%- endif %}
register: kubeadm_upgrade
when: inventory_hostname == first_kube_control_plane
failed_when: kubeadm_upgrade.rc != 0 and "field is immutable" not in kubeadm_upgrade.stderr
@ -37,7 +39,9 @@
{%- else %}
--config={{ kube_config_dir }}/kubeadm-config.yaml
{%- endif %}
{%- if kube_version is version('1.32.0', '>=') %}
--skip-phases={{ kubeadm_init_phases_skip | join(',') }}
{%- endif %}
register: kubeadm_upgrade
when: inventory_hostname != first_kube_control_plane
failed_when: kubeadm_upgrade.rc != 0 and "field is immutable" not in kubeadm_upgrade.stderr

Loading…
Cancel
Save