mirror of
https://github.com/ansible/awx-operator.git
synced 2026-05-07 13:52:58 +00:00
Fix volume mount syntax error
* conditionally run database-check init container only for managed db
deployments
Signed-off-by: Christian M. Adams <chadams@redhat.com>
This commit is contained in:
@@ -157,6 +157,10 @@
|
|||||||
retries: 60
|
retries: 60
|
||||||
when: pg_config['resources'][0]['data']['type'] | default('') | b64decode == 'managed'
|
when: pg_config['resources'][0]['data']['type'] | default('') | b64decode == 'managed'
|
||||||
|
|
||||||
|
- name: Set database as managed
|
||||||
|
set_fact:
|
||||||
|
managed_database: "{{ pg_config['resources'][0]['data']['type'] | default('') | b64decode == 'managed' }}"
|
||||||
|
|
||||||
- name: Look up details for this deployment
|
- name: Look up details for this deployment
|
||||||
k8s_info:
|
k8s_info:
|
||||||
api_version: "{{ api_version }}"
|
api_version: "{{ api_version }}"
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ spec:
|
|||||||
- name: {{ image_pull_secret }}
|
- name: {{ image_pull_secret }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
initContainers:
|
initContainers:
|
||||||
|
{% if managed_database %}
|
||||||
- name: database-check
|
- name: database-check
|
||||||
image: '{{ _init_container_image }}'
|
image: '{{ _init_container_image }}'
|
||||||
imagePullPolicy: '{{ image_pull_policy }}'
|
imagePullPolicy: '{{ image_pull_policy }}'
|
||||||
@@ -41,15 +42,12 @@ spec:
|
|||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
[[ -d /check-db/pgsql/data ]] && rm -rf /check-db/data; mv /check-db/pgsql/data/ /check-db/data/ && rm -rf /check-db/pgsql
|
[[ -d /check-db/pgsql/data ]] && rm -rf /check-db/data && mv /check-db/pgsql/data/ /check-db/data/ && rm -rf /check-db/pgsql || true
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: check-db-pvc
|
- name: check-db-pvc
|
||||||
mountPath: /check-db
|
mountPath: /check-db
|
||||||
subPath: ''
|
subPath: ''
|
||||||
volumes:
|
{% endif %}
|
||||||
- name: check-db-pvc
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: postgres-{{ ansible_operator_meta.name }}-postgres-0
|
|
||||||
{% if bundle_ca_crt or projects_persistence|bool or init_container_extra_commands %}
|
{% if bundle_ca_crt or projects_persistence|bool or init_container_extra_commands %}
|
||||||
- name: init
|
- name: init
|
||||||
image: '{{ _init_container_image }}'
|
image: '{{ _init_container_image }}'
|
||||||
@@ -340,6 +338,11 @@ spec:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
volumes:
|
volumes:
|
||||||
|
{% if managed_database %}
|
||||||
|
- name: check-db-pvc
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: postgres-{{ ansible_operator_meta.name }}-postgres-0
|
||||||
|
{% endif %}
|
||||||
{% if bundle_ca_crt %}
|
{% if bundle_ca_crt %}
|
||||||
- name: "ca-trust-extracted"
|
- name: "ca-trust-extracted"
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
|
|||||||
Reference in New Issue
Block a user