Skip to content

Commit

Permalink
feat: pre-pull ovn-controller image
Browse files Browse the repository at this point in the history
Closes-Bug: ATMOSPHERE-634
Depends-On: I0b15142aabab38fafab829a16cee0297b749e6e8
Change-Id: I2661648efde71b38be3c2ed32ef3375e8c7dae51
(cherry picked from commit bc6a06b)
  • Loading branch information
guilhermesteinmuller authored and mnaser committed Jan 19, 2025
1 parent 8e49b06 commit 57b08fb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
8 changes: 4 additions & 4 deletions playbooks/openstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
tags:
- iscsi

- name: Deploy Open vSwitch
- name: Deploy SDN
hosts: controllers:computes
become: true
gather_facts: false
Expand All @@ -88,13 +88,13 @@
tags:
- openvswitch

- hosts: controllers[0]
become: true
roles:
- role: ovn
tags:
- ovn

- hosts: controllers[0]
become: true
roles:
- role: libvirt
tags:
- libvirt
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
features:
- The ``ovn-controller`` image is now being pre-pulled on the nodes prior
to the Helm chart being deployed. This will help reduce the time it takes
to switch over to the new version of the ``ovn-controller`` image.
15 changes: 15 additions & 0 deletions roles/ovn/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@
- _ovn_controller_ds_info.resources | length > 0
- "'type' in _ovn_controller_ds_info.resources[0].spec.selector.matchLabels"

- name: Cache ovn-controller image before install or upgrade
block:
- name: Pull ovn-controller image
ansible.builtin.command: crictl pull {{ atmosphere_images['ovn_controller'] }}
register: pull_result
changed_when: false

- name: Verify ovn-controller image pull
ansible.builtin.assert:
that:
- pull_result.rc == 0
- "'Image is up to date' in pull_result.stdout or 'Image pulled' in pull_result.stdout"
fail_msg: "Failed to pull ovn-controller image"
success_msg: "Successfully pulled ovn-controller image"

- name: Deploy Helm chart
run_once: true
when: atmosphere_network_backend == 'ovn'
Expand Down

0 comments on commit 57b08fb

Please sign in to comment.