Bug 2060135

Summary: [assisted-install] agentServiceConfig left orphaned after uninstalling ACM
Product: Red Hat Advanced Cluster Management for Kubernetes Reporter: Thuy Nguyen <thnguyen>
Component: InstallerAssignee: Jakob <jagray>
Status: CLOSED ERRATA QA Contact: txue
Severity: medium Docs Contact: Christopher Dawson <cdawson>
Priority: unspecified    
Version: rhacm-2.5CC: alisauxbpn53, jwakely, mobinasalami3.1519
Target Milestone: ---Flags: bot-tracker-sync: rhacm-2.5+
Target Release: rhacm-2.5   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-09 02:09:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Thuy Nguyen 2022-03-02 19:28:44 UTC
Description of the problem: agentServiceConfig left orphaned after uninstalling ACM 

Release version:

Operator snapshot version:
- ACM 2.5.0-DOWNSTREAM-2022-03-01-18-33-27
- MCE 2.0.0-DOWNANDBACK-2022-03-02-01-20-35

OCP version:

Browser Info:

Steps to reproduce:
1. Install ACM + MCH + MCE
2. Create agentServiceConfig object 
3. Uninstall ACM

Actual results:
agentServiceConfig left orphaned after uninstalling ACM

Expected results:
Either the object is deleted when uninstalling MCE or a validation is thrown out preventing uninstalling ACM altogether (similar to uninstalling ACM when managed clusters exist)

Additional info:

1. agentServiceConfig yaml -
apiVersion: agent-install.openshift.io/v1beta1
kind: AgentServiceConfig
metadata:
  name: agent
spec:
  databaseStorage:
    storageClassName: rook-ceph-block
    accessModes:
    - ReadWriteOnce
    resources:
      requests:
        storage: 20Gi
  filesystemStorage:
    storageClassName: rook-ceph-block
    accessModes:
    - ReadWriteOnce
    resources:
      requests:
        storage: 50Gi
  mustGatherImages:
  - name: ocs
    openshiftVersion: '4.9'
    url: registry.redhat.io/ocs4/ocs-must-gather-rhel8
  osImages:
#  - cpuArchitecture: x86_64
#    openshiftVersion: '4.8'
#    rootFSUrl: https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.8/4.8.2/rhcos-live-rootfs.x86_64.img
#    url: https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.8/4.8.2/rhcos-4.8.2-x86_64-live.x86_64.iso
#    version: 48.84.202107202156-0
  - cpuArchitecture: x86_64
    openshiftVersion: '4.9'
    rootFSUrl: https://rhcos-redirector.apps.art.xq1c.p1.openshiftapps.com/art/storage/releases/rhcos-4.9/49.84.202110081407-0/x86_64/rhcos-49.84.202110081407-0-live-rootfs.x86_64.img
    url: https://rhcos-redirector.apps.art.xq1c.p1.openshiftapps.com/art/storage/releases/rhcos-4.9/49.84.202110081407-0/x86_64/rhcos-49.84.202110081407-0-live.x86_64.iso
    version: 49.84.202110081407-0

Comment 1 Jakob 2022-03-18 17:42:25 UTC
Replicate on latest builds. I plan on adding a check in the ACM and MCE webhooks to prevent uninstalling if there are AgentServiceConfigs present.

Comment 2 Jakob 2022-03-24 00:27:23 UTC
Both ACM and MCE will now block delete attempts if an AgentServiceConfig remains on the cluster. This change would be visible in snapshots 2.5.0-DOWNSTREAM-2022-03-23-01-06-05 and later

Comment 3 bot-tracker-sync 2022-04-06 19:12:14 UTC
G2Bsync 1090425047 comment 
 thuyn-581 Wed, 06 Apr 2022 15:47:02 UTC 
 G2BSync -
Validated on ACM 2.5.0-DOWNSTREAM-2022-04-05-06-20-55

Comment 6 errata-xmlrpc 2022-06-09 02:09:02 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Red Hat Advanced Cluster Management 2.5 security updates, images, and bug fixes), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:4956