Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-57195

InfraMachineTemplate is not deleted when deleting machineset

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • Moderate
    • None
    • None
    • None
    • CLOUD Sprint 272, CLOUD Sprint 273, CLOUD Sprint 274, CLOUD Sprint 275
    • 4
    • Done
    • Bug Fix
    • Hide
      * Before this update, the two-way synchronization controller on clusters that support migrating Machine API resources to Cluster API resources did not delete the machine template when its corresponding Machine API machine set was deleted.
      As a consequence, unneeded Cluster API machine templates persisted in the cluster and cluttered the `openshift-cluster-api` namespace.
      With this release, the two-way synchronization controller is updated to correctly handle deletion synchronization for the machine template.
      As a result, deleting a Machine API authoritative machine set deletes the corresponding Cluster API machine template.
      (link:https://issues.redhat.com/browse/OCPBUGS-57195[OCPBUGS-57195])
      Show
      * Before this update, the two-way synchronization controller on clusters that support migrating Machine API resources to Cluster API resources did not delete the machine template when its corresponding Machine API machine set was deleted. As a consequence, unneeded Cluster API machine templates persisted in the cluster and cluttered the `openshift-cluster-api` namespace. With this release, the two-way synchronization controller is updated to correctly handle deletion synchronization for the machine template. As a result, deleting a Machine API authoritative machine set deletes the corresponding Cluster API machine template. (link: https://issues.redhat.com/browse/OCPBUGS-57195 [ OCPBUGS-57195 ])
    • None
    • None
    • None
    • None

      Description of problem:

      Create a mapi machineset with authoritativeAPI: MachineAPI, delete mapi machineset, the awsmachinetemplate still exists 

      Version-Release number of selected component (if applicable):

      4.20.0-0.nightly-2025-06-08-062715

      How reproducible:

      Always

      Steps to Reproduce:

      1. Create a mapi machineset with authoritativeAPI: MachineAPI     
      2. Delete mapi machineset 
      3. Check awsmachinetemplate     

      Actual results:

      The capi/mapi machineset/machine will be deleted, but awsmachinetemplate still exists.
      
      $ oc delete machineset.m zhsunaws9-4k66m-worker-us-east-2cc    
      machineset.machine.openshift.io "zhsunaws9-4k66m-worker-us-east-2cc" deleted
      $ oc get machineset.m           
      NAME                                DESIRED   CURRENT   READY   AVAILABLE   AGE
      zhsunaws9-4k66m-worker-us-east-2a   1         1         1       1           4h18m
      zhsunaws9-4k66m-worker-us-east-2b   1         1         1       1           4h18m
      zhsunaws9-4k66m-worker-us-east-2c   1         1         1       1           4h18m
      $ oc get machineset.c -n openshift-cluster-api    
      NAME                                CLUSTER           REPLICAS   READY   AVAILABLE   AGE     VERSION
      zhsunaws9-4k66m-worker-us-east-2a   zhsunaws9-4k66m                                  3h59m
      zhsunaws9-4k66m-worker-us-east-2b   zhsunaws9-4k66m                                  4h4m
      zhsunaws9-4k66m-worker-us-east-2c   zhsunaws9-4k66m                                  3h59m
      $ oc get machines.cluster.x-k8s.io -n openshift-cluster-api    
      NAME                                      CLUSTER           NODENAME   PROVIDERID                              PHASE   AGE     VERSION
      zhsunaws9-4k66m-worker-us-east-2a-wc2xd   zhsunaws9-4k66m              aws:///us-east-2a/i-03e9de25592c533df           3h57m
      zhsunaws9-4k66m-worker-us-east-2b-4fk24   zhsunaws9-4k66m              aws:///us-east-2b/i-057c9a1569a51adf1           4h3m
      zhsunaws9-4k66m-worker-us-east-2c-9qwzl   zhsunaws9-4k66m              aws:///us-east-2c/i-00442ad9a6c752882           3h57m
      
      $ oc get machine.m             
      NAME                                      PHASE     TYPE         REGION      ZONE         AGE
      zhsunaws9-4k66m-master-0                  Running   m6i.xlarge   us-east-2   us-east-2a   4h23m
      zhsunaws9-4k66m-master-1                  Running   m6i.xlarge   us-east-2   us-east-2b   4h23m
      zhsunaws9-4k66m-master-2                  Running   m6i.xlarge   us-east-2   us-east-2c   4h23m
      zhsunaws9-4k66m-worker-us-east-2a-wc2xd   Running   m6i.xlarge   us-east-2   us-east-2a   4h20m
      zhsunaws9-4k66m-worker-us-east-2b-4fk24   Running   m6i.xlarge   us-east-2   us-east-2b   4h20m
      zhsunaws9-4k66m-worker-us-east-2c-9qwzl   Running   m6i.xlarge   us-east-2   us-east-2c   4h20m
      
      $ oc get awsmachinetemplate -n openshift-cluster-api 
      NAME                                 AGE
      zhsunaws9-4k66m-worker-us-east-2a    3h59m
      zhsunaws9-4k66m-worker-us-east-2b    4h5m
      zhsunaws9-4k66m-worker-us-east-2c    3h59m
      zhsunaws9-4k66m-worker-us-east-2cc   32m

      Expected results:

      The awsmachinetemplate will also be deleted

      Additional info:

          

              rmanak@redhat.com Radek Manak
              rhn-support-zhsun Zhaohua Sun
              None
              None
              Zhaohua Sun Zhaohua Sun
              None
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: