Skip to content

Commit

Permalink
fix: Check that resources are in kubeadm-config configmap before usin…
Browse files Browse the repository at this point in the history
…g them (#102)

In some conditions the k8s_info module can succeed but return and
empty list of resources. This can happen when the api server is
running but the kubeadm-config cm is missing, then the next tasks
fail with undefined variables.

This patch extends the condition on the kubernetes version check to
ensure that resources from kubeadm-config are present.

Co-authored-by: Jonathan Rosser <[email protected]>
  • Loading branch information
jrosser and Jonathan Rosser authored Apr 20, 2024
1 parent 9fac93a commit 896d670
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion roles/kubernetes_upgrade_check/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
register: kubernetes_upgrade_check_kubeadm_config

- name: Determine if we are jumping multiple versions
when: kubernetes_upgrade_check_kubeadm_config is not failed
when:
- kubernetes_upgrade_check_kubeadm_config is not failed
- kubernetes_upgrade_check_kubeadm_config.resources | length > 0
block:
- name: Parse the ClusterConfiguration
run_once: true
Expand Down

0 comments on commit 896d670

Please sign in to comment.