Quellcode durchsuchen

openshift-control-plane: check whether the sync pods are ready before selecting nodes

If the sync pod is not ready, then the node selection might fail due to pods
not being labeled yet. (https://bugzilla.redhat.com/show_bug.cgi?id=1609019)
Paul Gier vor 6 Jahren
Ursprung
Commit
9894aea3b8
1 geänderte Dateien mit 19 neuen und 0 gelöschten Zeilen
  1. 19 0
      roles/openshift_node_group/tasks/sync.yml

+ 19 - 0
roles/openshift_node_group/tasks/sync.yml

@@ -46,3 +46,22 @@
     state: absent
     name: "{{ mktemp.stdout }}"
   changed_when: False
+
+- name: Wait for the sync daemonset to become ready and available
+  oc_obj:
+    state: list
+    kind: daemonset
+    name: sync
+    namespace: openshift-node
+  register: __status_of_sync_ds
+  until:
+    - __status_of_sync_ds.results is defined
+    - __status_of_sync_ds.results.results is defined
+    - __status_of_sync_ds.results.results | length > 0
+    - __status_of_sync_ds.results.results[0].status is defined
+    - __status_of_sync_ds.results.results[0].status.numberAvailable is defined
+    - __status_of_sync_ds.results.results[0].status.desiredNumberScheduled is defined
+    - __status_of_sync_ds.results.results[0].status.numberAvailable == __status_of_sync_ds.results.results[0].status.desiredNumberScheduled
+  retries: 60
+  delay: 30
+  failed_when: false