ansible / awx-operator

An Ansible AWX operator for Kubernetes built with Operator SDK and Ansible. 🤖
https://www.github.com/ansible/awx
Apache License 2.0
1.23k stars 624 forks source link

removing automationcontroller resource does not clean deployments #1560

Open jangel97 opened 1 year ago

jangel97 commented 1 year ago

Please confirm the following

Bug Summary

Hello,

I followed this doc https://access.redhat.com/documentation/en-us/red_hat_ansible_automation_platform/2.4/html/deploying_the_red_hat_ansible_automation_platform_operator_on_openshift_container_platform/installing-aap-operator-cli

If I ran command oc delete automationcontroller --all, all the deployments will still remain in my project. Wouldnt it make sense that when I remove the automationcontroller instance all the managed subresources are deleted as well?

Kind regards,

AWX Operator version

AAP 2.4

AWX version

AAP 2.4

Kubernetes platform

openshift

Kubernetes/Platform version

openshift 4.13

Modifications

no

Steps to reproduce

Run this command:

cat <<EOF > oc apply -f -
---
apiVersion: v1
kind: Namespace
metadata:
  labels:
    openshift.io/cluster-monitoring: "true"
  name: ansible-automation-platform
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: ansible-automation-platform-operator
  namespace: ansible-automation-platform
spec:
  targetNamespaces:
    - ansible-automation-platform
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: ansible-automation-platform
  namespace: ansible-automation-platform
spec:
  channel: 'stable-2.4'
  installPlanApproval: Automatic
  name: ansible-automation-platform-operator
  source: redhat-operators
  sourceNamespace: openshift-marketplace
---
apiVersion: automationcontroller.ansible.com/v1beta1
kind: AutomationController
metadata:
  name: dummy
  namespace: ansible-automation-platform
spec:
  replicas: 1
EOF

Then run this command:

oc delete automationcontroller --all -n ansible-automation-platform

The run this command:

oc get deploy -n  ansible-automation-platform

You will see that pods, deployments and replicasets (all the managed subresources are still there).

Expected results

I would expect subresources to be removed.

Actual results

Subresources are not removed

Additional information

No response

Operator Logs

No response

fosterseth commented 1 year ago

@TheRealHaoLiu what is the expected behavior here?

fosterseth commented 12 months ago

@jangel97 did you stop or delete the operator before running the oc delete automationcontroller --all -n ansible-automation-platform?

imedaouidene commented 12 months ago

@jangel97 couldn't reproduce the issue you are getting, with the same OCP & AAP versions. If this is really happening maybe an implementation of finalizers could help .