Skip to content

Commit

Permalink
Use release file from cache directory
Browse files Browse the repository at this point in the history
- Use the release.txt file from the provisioning cache instead of the web server.
- The webserver url is not required for an upgrade
- The task "Wait for an updated clusterversion" is only required when the upstream graph is used but here we always have a target_version

TestBos2Sno: sno
Test-hints: no-check

Change-Id: I6eb827b2edb31b0efbb1e8eaa40894f86d26a0b1
  • Loading branch information
betoredhat committed Feb 5, 2025
1 parent 7974738 commit 6fff21b
Showing 1 changed file with 10 additions and 29 deletions.
39 changes: 10 additions & 29 deletions plays/upgrade-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,17 @@
- name: "Get and apply release signature"
when: build != "nightly"
block:
- name: "Fetch release.txt"
ansible.builtin.uri:
url: "{{ webserver_url }}/{{ target_version }}/release.txt"
return_content: true
timeout: 10
register: release_file
until: release_file.status == 200
retries: 6
delay: 10
failed_when:
- release_file.content|length == 0 or release_file.status >= 400

- name: "Release digest"

- name: "Read the release file"
slurp:
src: "{{ provision_cache_store | default(ansible_env.HOME + '/releases') }}/{{ target_version }}/release.txt"
register: release_file_raw

- name: "Set release image digest"
vars:
release_file: "{{ release_file_raw['content'] | b64decode }}"
set_fact:
release_digest: "{{ release_file.content | regex_search('^Digest:\\s+sha256:(.*)$', '\\1', multiline=True) | first }}"
release_digest: "{{ release_file | regex_search('^Digest:\\s+sha256:(.*)$', '\\1', multiline=True) | first }}"

- name: "Download the release signature"
ansible.builtin.uri:
Expand Down Expand Up @@ -140,21 +136,6 @@
retries: 10
delay: 60

- name: "Wait for an updated clusterversion"
kubernetes.core.k8s_info:
kind: ClusterVersion
name: version
register: cv_info
vars:
status_query: "conditions[?type=='RetrievedUpdates'].status"
upgrade_status: "{{ cv_info.resources[0].status | json_query(status_query) }}"
until:
- upgrade_status == ['True']
when:
- not force_upgrade | default(false) | bool
retries: 10
delay: 60

- name: "Execute cluster upgrade command"
block:
- name: "Execute the upgrade to {{ target_version }}"
Expand Down

0 comments on commit 6fff21b

Please sign in to comment.