mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-14 13:54:37 +03:00
Fix: upgrade cluster discovery kubeconfig not found
When installing or upgrading in the past, there was no validation config. Check if the file exists first to prevent subsequent validation errors. Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
This commit is contained in:
@@ -58,6 +58,11 @@
|
||||
delegate_to: "{{ groups['kube_control_plane'] | first }}"
|
||||
when: kubeadm_use_file_discovery
|
||||
|
||||
- name: Check if discovery kubeconfig exists
|
||||
stat:
|
||||
path: "{{ kube_config_dir }}/cluster-info-discovery-kubeconfig.yaml"
|
||||
register: cluster_info_discovery_kubeconfig
|
||||
|
||||
- name: Copy discovery kubeconfig
|
||||
copy:
|
||||
dest: "{{ kube_config_dir }}/cluster-info-discovery-kubeconfig.yaml"
|
||||
@@ -66,7 +71,7 @@
|
||||
mode: "0644"
|
||||
when:
|
||||
- ('kube_control_plane' not in group_names)
|
||||
- not kubelet_conf.stat.exists
|
||||
- not kubelet_conf.stat.exists or not cluster_info_discovery_kubeconfig.stat.exists
|
||||
- kubeadm_use_file_discovery
|
||||
|
||||
- name: Create kubeadm client config
|
||||
|
||||
Reference in New Issue
Block a user