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

Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
Co-authored-by: bo.jiang <bo.jiang@daocloud.io>
This commit is contained in:
k8s-infra-cherrypick-robot
2025-06-28 05:44:29 -07:00
committed by GitHub
parent 4789e9dd89
commit 22e9335484

View File

@@ -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