mirror of
https://github.com/ansible/awx-operator.git
synced 2026-03-26 21:33:14 +00:00
Add owner ref on AWXMeshIngress to AWX
This way when AWX is deleted associated AWXMeshIngress will all be deleted as well
This commit is contained in:
@@ -39,6 +39,7 @@ spec:
|
||||
- --leader-elect
|
||||
- --leader-election-id=awx-operator
|
||||
image: controller:latest
|
||||
imagePullPolicy: Always
|
||||
name: awx-manager
|
||||
env:
|
||||
- name: ANSIBLE_GATHERING
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
deployment_type: awx
|
||||
|
||||
set_self_owneref: true
|
||||
|
||||
_control_plane_ee_image: quay.io/ansible/awx-ee:latest
|
||||
_image_pull_policy: Always
|
||||
|
||||
@@ -24,6 +24,26 @@
|
||||
set_fact:
|
||||
awx_spec: "{{ awx_instance.resources[0].spec }}"
|
||||
|
||||
- name: Set owner_reference of AWXMeshIngress to related AWX instance
|
||||
k8s:
|
||||
state: present
|
||||
definition:
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: AWX
|
||||
name: "{{ deployment_name }}"
|
||||
namespace: "{{ ansible_operator_meta.namespace }}"
|
||||
metadata:
|
||||
name: "{{ deployment_name }}"
|
||||
namespace: "{{ ansible_operator_meta.namespace }}"
|
||||
ownerReferences:
|
||||
- apiVersion: awx.ansible.com/v1beta1
|
||||
blockOwnerDeletion: true
|
||||
controller: true
|
||||
kind: AWX
|
||||
name: "{{ deployment_name }}"
|
||||
uid: "{{ awx_instance.resources[0].metadata.uid }}"
|
||||
when: set_self_owneref | bool
|
||||
|
||||
- name: Set user provided control plane ee image
|
||||
set_fact:
|
||||
_custom_control_plane_ee_image: "{{ awx_spec.control_plane_ee_image }}"
|
||||
@@ -48,6 +68,7 @@
|
||||
when: is_openshift | bool
|
||||
|
||||
# TODO: need to wait until the route is ready before we can get the hostname
|
||||
# right now this will rereconcile until the route is ready
|
||||
|
||||
- name: Set external_hostname
|
||||
set_fact:
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
kind: AWXRestore
|
||||
role: restore
|
||||
snakeCaseParameters: False
|
||||
|
||||
- version: v1alpha1
|
||||
group: awx.ansible.com
|
||||
kind: AWXMeshIngress
|
||||
|
||||
Reference in New Issue
Block a user