Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get AEE runner from OpenstackVersion #469

Merged
merged 1 commit into from
May 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 10 additions & 38 deletions tests/roles/dataplane_adoption/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,17 @@
ceph_backend_configuration_fsid_shell_vars: |
CEPH_FSID=$(oc get secret ceph-conf-files -o json | jq -r '.data."ceph.conf"' | base64 -d | grep fsid | sed -e 's/fsid = //')
- name: Patch ansibleee csv to use image built from source or latest if none is defined
- name: Patch openstackversion to use image built from source or latest if none is defined
when: not skip_patching_ansibleee_csv | bool
block:
- name: Save ansibleee-operator pod name to be able to wait for the rollout of the new pod
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
oc get -n openstack-operators pod -l app.kubernetes.io/name=openstack-ansibleee-operator -o name
register: old_ansibleee_operator_pod

- name: Get ansibleee-operator csv name
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
oc get csv -n openstack-operators -o name | grep ansibleee-operator
register: _ansibleee_csv_name

- name: use ansible-runner image built from source or latest if none is defined
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
{{ oc_login_command }}
# openstack-operator catalog pins the sha256, which might differ from latest with time
oc patch -n openstack-operators "{{ _ansibleee_csv_name.stdout }}" \
--type='json' -p='[{
"op":"replace", "path":"/spec/install/spec/deployments/0/spec/template/spec/containers/1/env/0",
"value": {"name": "RELATED_IMAGE_ANSIBLEEE_IMAGE_URL_DEFAULT", "value": "{{ ansibleee_runner_img | default('quay.io/openstack-k8s-operators/openstack-ansibleee-runner:latest')}}"}}]'
register: ansibleee_csv_patched

- name: Wait for the ansible-operator to restart with the new ENV
no_log: "{{ use_no_log }}"
when: '"no change" not in ansibleee_csv_patched.stdout'
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
oc wait -n openstack-operators --timeout=120s --for=delete {{ old_ansibleee_operator_pod.stdout }}
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
{{ oc_login_command }}
oc patch -n openstack openstackversion openstack \
--type='json' -p='[{
"op":"replace", "path":"/spec/customContainerImages/ansibleeeImage",
"value": "{{ ansibleee_runner_img | default('quay.io/openstack-k8s-operators/openstack-ansibleee-runner:latest')}}"}]'
- name: ensure namespace
no_log: "{{ use_no_log }}"
Expand Down
Loading