Browse Source

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>
pull/12132/head
ChengHao Yang 4 months ago
parent
commit
ac0b0e7d6e
Failed to extract signature
1 changed files with 6 additions and 1 deletions
  1. 7
      roles/kubernetes/kubeadm/tasks/main.yml

7
roles/kubernetes/kubeadm/tasks/main.yml

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

Loading…
Cancel
Save