Fix breakage when ignoring all kubeadm preflight errors (#12618)

kubeadm errors out if 'all' is specified with specific checks, so check
that case when we add hardcoded checks.

Add a test to catch regression.

Co-authored-by: Max Gautier <mg@max.gautier.name>
This commit is contained in:
k8s-infra-cherrypick-robot
2025-11-17 22:27:37 -08:00
committed by GitHub
parent 87597b044d
commit 406ea25217
2 changed files with 6 additions and 2 deletions

View File

@@ -86,13 +86,13 @@
- not kubelet_conf.stat.exists
vars:
ignored:
- DirAvailable--etc-kubernetes-manifests
- "{{ 'DirAvailable--etc-kubernetes-manifests' if 'all' not in kubeadm_ignore_preflight_errors }}"
- "{{ kubeadm_ignore_preflight_errors }}"
command: >-
timeout -k {{ kubeadm_join_timeout }} {{ kubeadm_join_timeout }}
{{ bin_dir }}/kubeadm join
--config {{ kube_config_dir }}/kubeadm-client.conf
--ignore-preflight-errors={{ ignored | flatten | join(',') }}
--ignore-preflight-errors={{ ignored | select | flatten | join(',') }}
--skip-phases={{ kubeadm_join_phases_skip | join(',') }}
- name: Update server field in kubelet kubeconfig

View File

@@ -9,3 +9,7 @@ etcd_deployment_type: kubeadm
kubeadm_certificate_key: 3998c58db6497dd17d909394e62d515368c06ec617710d02edea31c06d741085
skip_non_kubeadm_warning: true
kube_asymmetric_encryption_algorithm: "RSA-4096"
# This test the variable usage, it is not a prerequisite of the test itself
kubeadm_ignore_preflight_errors:
- all