mirror of
https://github.com/ansible/awx-operator.git
synced 2026-03-26 21:33:14 +00:00
Fix custom backup PVC name not used with create_backup_pvc (#2105)
Use backup_pvc for custom backup PVC name in templates When backup_pvc is specified with create_backup_pvc: true, the PVC template and ownerReference removal used the hardcoded default name (deployment_name-backup-claim) instead of the user-specified name. This caused the management pod to reference a PVC that didn't exist. Replace backup_claim variable with backup_pvc throughout the backup role so the resolved PVC name is used consistently in all templates. Authored By: Adam Knochowski <aknochow@redhat.com> Assisted By: Claude
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
# by default, it will re-use the old pvc if already created (unless a pvc is provided)
|
# by default, it will re-use the old pvc if already created (unless a pvc is provided)
|
||||||
- name: Set PVC to use for backup
|
- name: Set PVC to use for backup
|
||||||
set_fact:
|
set_fact:
|
||||||
backup_claim: "{{ backup_pvc | default(_default_backup_pvc, true) }}"
|
backup_pvc: "{{ backup_pvc | default(_default_backup_pvc, true) }}"
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Create PVC for backup
|
- name: Create PVC for backup
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
metadata:
|
metadata:
|
||||||
name: "{{ deployment_name }}-backup-claim"
|
name: "{{ backup_pvc }}"
|
||||||
namespace: "{{ backup_pvc_namespace }}"
|
namespace: "{{ backup_pvc_namespace }}"
|
||||||
ownerReferences: null
|
ownerReferences: null
|
||||||
when:
|
when:
|
||||||
|
|||||||
@@ -9,5 +9,5 @@
|
|||||||
namespace: "{{ ansible_operator_meta.namespace }}"
|
namespace: "{{ ansible_operator_meta.namespace }}"
|
||||||
status:
|
status:
|
||||||
backupDirectory: "{{ backup_dir }}"
|
backupDirectory: "{{ backup_dir }}"
|
||||||
backupClaim: "{{ backup_claim }}"
|
backupClaim: "{{ backup_pvc }}"
|
||||||
when: backup_complete
|
when: backup_complete
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ deployment_name }}-backup-claim
|
name: {{ backup_pvc }}
|
||||||
namespace: "{{ backup_pvc_namespace }}"
|
namespace: "{{ backup_pvc_namespace }}"
|
||||||
ownerReferences: null
|
ownerReferences: null
|
||||||
labels:
|
labels:
|
||||||
|
|||||||
@@ -27,6 +27,6 @@ spec:
|
|||||||
volumes:
|
volumes:
|
||||||
- name: {{ ansible_operator_meta.name }}-backup
|
- name: {{ ansible_operator_meta.name }}-backup
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: {{ backup_claim }}
|
claimName: {{ backup_pvc }}
|
||||||
readOnly: false
|
readOnly: false
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
|
|||||||
Reference in New Issue
Block a user