Skip to content

Commit c7d6d1b

Browse files
committed
Fix version_update role - after failed upgrade
Signed-off-by: Justin Cinkelj <justin.cinkelj@xlab.si>
1 parent 6b19a8b commit c7d6d1b

File tree

1 file changed

+14
-1
lines changed
  • tests/integration/targets/version_update/tasks

1 file changed

+14
-1
lines changed

tests/integration/targets/version_update/tasks/main.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,22 @@
2525
scale_computing.hypercore.version_update_status_info:
2626
register: update_status
2727
# Fail early if update is in progress
28+
# In some cases update fails and we get record.update_status == None
29+
# Example from https://172.31.6.11/update/update_status.json
30+
# {
31+
# "prepareStatus": "",
32+
# "updateStatus": {
33+
# "percent": "0",
34+
# "status": {
35+
# "usernotes": "Failed to open update tunnel"
36+
# }
37+
# }
38+
#}
2839
- ansible.builtin.assert:
2940
that:
3041
- >-
3142
update_status.record == None or
43+
update_status.record.update_status == None or
3244
update_status.record.update_status == "COMPLETED" or
3345
update_status.record.update_status == "TERMINATING"
3446
@@ -54,11 +66,12 @@
5466
- update.diff.before.icos_version == cluster_initial.record.icos_version
5567
- update.diff.after.icos_version == updates.records[0].uuid
5668

57-
- name: Get status of the latest update applied
69+
- name: Wait on update to move into EXECUTING state
5870
scale_computing.hypercore.version_update_status_info:
5971
register: update_status
6072
# It takes a while (2 minutes) for update_status.json to appear.
6173
# We get update_status.record=None on first invocation.
74+
# Should we quit waiting if update_status.record.update_status == None ? It could be transient state.
6275
until: update_status.record != None and update_status.record.update_status == "EXECUTING"
6376
retries: 100
6477
delay: 5

0 commit comments

Comments
 (0)