Skip to content

Commit 91d3e59

Browse files
committed
Add retries to kustomize_deploy tasks
We observe the following errors randomly occurring from `kubernetes.core.k8s_info` module, typically just after waiting for the openstack operators InstallPlan to be finished: `AttributeError: ''NoneType'' object has no attribute ''status''`. This may be because the OpenShift cluster gets overwhelmed and sometimes the module receives the unexpected response, so in `custom_condition()` in `plugins/module_utils/k8s/waiter.py` there is no `status` field in `resource` [1]. As a mitigation, let's try retrying the task after some delay. [1] https://github.com/ansible-collections/kubernetes.core/blob/main/plugins/module_utils/k8s/waiter.py#L86
1 parent 5486e25 commit 91d3e59

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

roles/kustomize_deploy/tasks/install_operators.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@
166166
type: Ready
167167
status: "True"
168168
wait_timeout: 300
169+
retries: 3
170+
delay: 60
171+
register: _cert_manager_operator_pods
172+
until: _cert_manager_operator_pods is success
169173

170174
- name: Wait for cainjector pods
171175
kubernetes.core.k8s_info:
@@ -179,6 +183,10 @@
179183
type: Ready
180184
status: "True"
181185
wait_timeout: 300
186+
retries: 3
187+
delay: 60
188+
register: _cainjector_pods
189+
until: _cainjector_pods is success
182190

183191
- name: Wait for webhook pods
184192
kubernetes.core.k8s_info:
@@ -192,6 +200,10 @@
192200
type: Ready
193201
status: "True"
194202
wait_timeout: 300
203+
retries: 3
204+
delay: 60
205+
register: _webhook_pods
206+
until: _webhook_pods is success
195207

196208
- name: Wait for certmanager pods
197209
kubernetes.core.k8s_info:
@@ -205,6 +217,10 @@
205217
type: Ready
206218
status: "True"
207219
wait_timeout: 300
220+
retries: 3
221+
delay: 60
222+
register: _certmanager_pods
223+
until: _certmanager_pods is success
208224

209225
- name: Create catalog source and switch dependent operators to consume it
210226
when:

0 commit comments

Comments
 (0)