Compare commits

..

4 Commits

Author SHA1 Message Date
Christian Adams
d27ce3c34d Merge pull request #755 from rooftopcellist/mv-data-subPath
Use an Init Container to move the pg data subPath in the pvc
2022-01-27 19:55:48 -05:00
Shane McDonald
18d17f2485 Merge pull request #763 from sooslaca/devel
Fix issue #762
2022-01-27 08:16:33 -05:00
sooslaca
8f8336b25a Fix issue #762
Fix https://github.com/ansible/awx-operator/issues/762
2022-01-23 16:17:24 +01:00
Christian M. Adams
5b636bb8ea Use an Init Container to move the pg data subPath in the pvc 2022-01-13 23:17:33 -05:00
2 changed files with 17 additions and 1 deletions

View File

@@ -60,7 +60,7 @@
- name: Set Init image URL
set_fact:
_init_container_image: |
_init_container_image: >-
{{ _custom_init_container_image |
default(lookup('env', 'RELATED_IMAGE_AWX_INIT_CONTAINER')) |
default(_default_init_container_image, true) }}

View File

@@ -35,6 +35,22 @@ spec:
{% endif %}
{% if bundle_ca_crt or projects_persistence|bool or init_container_extra_commands %}
initContainers:
- name: database-check
image: '{{ _init_container_image }}'
imagePullPolicy: '{{ image_pull_policy }}'
command:
- /bin/sh
- -c
- |
[[ -d /check-db/pgsql/data ]] && rm -rf /check-db/data; mv /check-db/pgsql/data/ /check-db/data/ && rm -rf /check-db/pgsql
volumeMounts:
- name: check-db-pvc
mountPath: /check-db
subPath: ''
volumes:
- name: check-db-pvc
persistentVolumeClaim:
claimName: postgres-{{ ansible_operator_meta.name }}-postgres-0
- name: init
image: '{{ _init_container_image }}'
imagePullPolicy: '{{ image_pull_policy }}'