mirror of
https://github.com/ansible/awx-operator.git
synced 2026-03-27 05:43:11 +00:00
Omit storage resource limit if empty (#1637)
We discovered some weird behavior observed on later Kubernetes version (OCP 4.12+)
For some reason why we apply the templates postgres resource with
```
postgres_storage_requirements:
limit: {}
requests:
storage: <x>Gi
```
the `Create Database if no database is specified` task that does the k8s apply will always think the resource is "changed" and proceed to cycle the task and web pod
This resulted in AWX pods being continuously restarted
Update postgres.yaml.j2
This commit is contained in:
@@ -33,7 +33,7 @@ spec:
|
||||
app.kubernetes.io/instance: 'postgres-{{ supported_pg_version }}-{{ ansible_operator_meta.name }}'
|
||||
app.kubernetes.io/component: 'database'
|
||||
app.kubernetes.io/part-of: '{{ ansible_operator_meta.name }}'
|
||||
app.kubernetes.io/managed-by: '{{ deployment_type }}-operator'
|
||||
app.kubernetes.io/managed-by: '{{ deployment_type }}-operator'
|
||||
spec:
|
||||
{% if image_pull_secret is defined %}
|
||||
imagePullSecrets:
|
||||
@@ -137,7 +137,15 @@ spec:
|
||||
{% if postgres_storage_class is defined %}
|
||||
storageClassName: '{{ postgres_storage_class }}'
|
||||
{% endif %}
|
||||
resources: {{ postgres_storage_requirements }}
|
||||
resources:
|
||||
{% if postgres_storage_requirements.limits.storage | default("", true) %}
|
||||
limits:
|
||||
storage: {{ postgres_storage_requirements.limits.storage }}
|
||||
{% endif %}
|
||||
{% if postgres_storage_requirements.requests.storage | default("", true) %}
|
||||
requests:
|
||||
storage: {{ postgres_storage_requirements.requests.storage }}
|
||||
{% endif %}
|
||||
|
||||
# Postgres Service.
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user