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

mapi machine with empty AuthoritativeAPI is set to AuthoritativeAPI:MachineAPI when there is same name capi machine

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • Moderate
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

        mapi machine with empty AuthoritativeAPI is set to AuthoritativeAPI:MachineAPI but should be AuthoritativeAPI:ClusterAPI when there is same name capi machine according to the enhancement doc https://github.com/openshift/enhancements/blob/master/enhancements/machine-api/converting-machine-api-to-cluster-api.md#summary-of-the-rules-outlined-above
      Machine API '' Create Yes - Annotation is set to ClusterAPI and follows above description 

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

          4.20.0-0.nightly-2025-05-27-133818 

      How reproducible:

          always

      Steps to Reproduce:

          1.Create a capi standalone machine, it create success, then checked it's paused shows false 
      
      liuhuali@Lius-MacBook-Pro huali-test % oc get machine.c -n openshift-cluster-api
      NAME                                         CLUSTER              NODENAME                                   PROVIDERID                              PHASE     AGE     VERSION
      huliu-aws28a-htsg5-worker-5                  huliu-aws28a-htsg5   ip-10-0-83-48.us-east-2.compute.internal   aws:///us-east-2c/i-0030eec51e080ada3   Running   6m40s       
      huliu-aws28a-htsg5-worker-us-east-2a-n2w4k   huliu-aws28a-htsg5   ip-10-0-15-33.us-east-2.compute.internal   aws:///us-east-2a/i-09c425eb8ffd48116   Running   5h47m   
      huliu-aws28a-htsg5-worker-us-east-2b-xg5nt   huliu-aws28a-htsg5   ip-10-0-38-61.us-east-2.compute.internal   aws:///us-east-2b/i-0161134d3ca7125a2   Running   5h44m   
      huliu-aws28a-htsg5-worker-us-east-2c-s5gxn   huliu-aws28a-htsg5                                              aws:///us-east-2c/i-05310e663dc0ca96c             7h52m   
      liuhuali@Lius-MacBook-Pro huali-test % oc get awsmachine -n openshift-cluster-api
      NAME                                         CLUSTER              STATE     READY   INSTANCEID                              MACHINE
      huliu-aws28a-htsg5-worker-5                  huliu-aws28a-htsg5   running   true    aws:///us-east-2c/i-0030eec51e080ada3   huliu-aws28a-htsg5-worker-5
      huliu-aws28a-htsg5-worker-us-east-2a-n2w4k   huliu-aws28a-htsg5   running   true    aws:///us-east-2a/i-09c425eb8ffd48116   huliu-aws28a-htsg5-worker-us-east-2a-n2w4k
      huliu-aws28a-htsg5-worker-us-east-2b-xg5nt   huliu-aws28a-htsg5   running   true    aws:///us-east-2b/i-0161134d3ca7125a2   huliu-aws28a-htsg5-worker-us-east-2b-xg5nt
      huliu-aws28a-htsg5-worker-us-east-2c-s5gxn   huliu-aws28a-htsg5                     aws:///us-east-2c/i-05310e663dc0ca96c   huliu-aws28a-htsg5-worker-us-east-2c-s5gxn
      
          2.Create a same name mapi machine with empty AuthoritativeAPI 
      
      liuhuali@Lius-MacBook-Pro huali-test % cat ms1.yaml 
      apiVersion: machine.openshift.io/v1beta1
      kind: Machine
      metadata:
        name: huliu-aws28a-htsg5-worker-5
        namespace: openshift-machine-api
      spec:
        authoritativeAPI:
        lifecycleHooks: {}
        metadata: {}
        providerSpec:
          value:
            ami:
              id: ami-0d4a7b7677c0c883f
            apiVersion: machine.openshift.io/v1beta1
            blockDevices:
            - ebs:
                encrypted: true
                iops: 0
                kmsKey:
                  arn: ""
                volumeSize: 100
                volumeType: gp3
            capacityReservationId: ""
            credentialsSecret:
              name: aws-cloud-credentials
            deviceIndex: 0
            iamInstanceProfile:
              id: huliu-aws28a-htsg5-worker-profile
            instanceType: m6i.xlarge
            kind: AWSMachineProviderConfig
            metadata:
              creationTimestamp: null
            metadataServiceOptions: {}
            placement:
              availabilityZone: us-east-2c
              region: us-east-2
            securityGroups:
            - filters:
              - name: tag:Name
                values:
                - huliu-aws28a-htsg5-node
            - filters:
              - name: tag:Name
                values:
                - huliu-aws28a-htsg5-lb
            subnet:
              filters:
              - name: tag:Name
                values:
                - huliu-aws28a-htsg5-subnet-private-us-east-2c
            tags:
            - name: kubernetes.io/cluster/huliu-aws28a-htsg5
              value: owned
            userDataSecret:
              name: worker-user-data
      liuhuali@Lius-MacBook-Pro huali-test % 
      
          3.The mapi machine created success, and authoritativeAPI is set to MachineAPI. But according to enhancement doc https://github.com/openshift/enhancements/blob/master/enhancements/machine-api/converting-machine-api-to-cluster-api.md#summary-of-the-rules-outlined-above, it should be set to ClusterAPI
      
      Machine API '' Create Yes - Annotation is set to ClusterAPI and follows above description
      
      liuhuali@Lius-MacBook-Pro huali-test % oc create -f ms1.yaml 
      machine.machine.openshift.io/huliu-aws28a-htsg5-worker-5 created
      liuhuali@Lius-MacBook-Pro huali-test % oc get machine
      NAME                                         PHASE          TYPE         REGION      ZONE         AGE
      huliu-aws28a-htsg5-master-0                  Running        m6i.xlarge   us-east-2   us-east-2a   8h
      huliu-aws28a-htsg5-master-1                  Running        m6i.xlarge   us-east-2   us-east-2b   8h
      huliu-aws28a-htsg5-master-2                  Running        m6i.xlarge   us-east-2   us-east-2c   8h
      huliu-aws28a-htsg5-worker-5                  Running        m6i.xlarge   us-east-2   us-east-2c   4s
      huliu-aws28a-htsg5-worker-us-east-2a-n2w4k   Provisioning                                         5h52m
      huliu-aws28a-htsg5-worker-us-east-2b-xg5nt                                                        5h48m
      huliu-aws28a-htsg5-worker-us-east-2c-s5gxn   Running        m6i.xlarge   us-east-2   us-east-2c   8h      
      
      liuhuali@Lius-MacBook-Pro huali-test % oc get machine huliu-aws28a-htsg5-worker-5  -oyaml
      apiVersion: machine.openshift.io/v1beta1
      kind: Machine
      metadata:
        annotations:
          machine.openshift.io/instance-state: running
        creationTimestamp: "2025-05-28T10:00:19Z"
        finalizers:
        - sync.machine.openshift.io/finalizer
        - machine.machine.openshift.io
        generation: 2
        labels:
          machine.openshift.io/cluster-api-cluster: huliu-aws28a-htsg5
          machine.openshift.io/instance-type: m6i.xlarge
          machine.openshift.io/region: us-east-2
          machine.openshift.io/zone: us-east-2c
        name: huliu-aws28a-htsg5-worker-5
        namespace: openshift-machine-api
        resourceVersion: "205553"
        uid: ea32dd7b-a424-493b-b5cb-720aa5fc1b58
      spec:
        authoritativeAPI: MachineAPI
        lifecycleHooks: {}
        metadata: {}
        providerID: aws:///us-east-2c/i-0030eec51e080ada3
        providerSpec:
          value:
            ami:
              id: ami-0d4a7b7677c0c883f
            apiVersion: machine.openshift.io/v1beta1
            blockDevices:
            - ebs:
                encrypted: true
                iops: 0
                kmsKey:
                  arn: ""
                volumeSize: 100
                volumeType: gp3
            capacityReservationId: ""
            credentialsSecret:
              name: aws-cloud-credentials
            deviceIndex: 0
            iamInstanceProfile:
              id: huliu-aws28a-htsg5-worker-profile
            instanceType: m6i.xlarge
            kind: AWSMachineProviderConfig
            metadata:
              creationTimestamp: null
            metadataServiceOptions: {}
            placement:
              availabilityZone: us-east-2c
              region: us-east-2
            securityGroups:
            - filters:
              - name: tag:Name
                values:
                - huliu-aws28a-htsg5-node
            - filters:
              - name: tag:Name
                values:
                - huliu-aws28a-htsg5-lb
            subnet:
              filters:
              - name: tag:Name
                values:
                - huliu-aws28a-htsg5-subnet-private-us-east-2c
            tags:
            - name: kubernetes.io/cluster/huliu-aws28a-htsg5
              value: owned
            userDataSecret:
              name: worker-user-data
      status:
        addresses:
        - address: 10.0.83.48
          type: InternalIP
        - address: ip-10-0-83-48.us-east-2.compute.internal
          type: InternalDNS
        - address: ip-10-0-83-48.us-east-2.compute.internal
          type: Hostname
        authoritativeAPI: MachineAPI
        conditions:
        - lastTransitionTime: "2025-05-28T10:00:19Z"
          status: "True"
          type: Drainable
        - lastTransitionTime: "2025-05-28T10:00:20Z"
          status: "True"
          type: InstanceExists
        - lastTransitionTime: "2025-05-28T10:00:19Z"
          message: The AuthoritativeAPI is set to MachineAPI
          reason: AuthoritativeAPIMachineAPI
          severity: Info
          status: "False"
          type: Paused
        - lastTransitionTime: "2025-05-28T10:00:20Z"
          message: Successfully synchronized MAPI Machine to CAPI
          reason: ResourceSynchronized
          severity: ""
          status: "True"
          type: Synchronized
        - lastTransitionTime: "2025-05-28T10:00:19Z"
          status: "True"
          type: Terminable
        lastUpdated: "2025-05-28T10:00:20Z"
        nodeRef:
          kind: Node
          name: ip-10-0-83-48.us-east-2.compute.internal
          uid: fbd9bead-6a30-47cd-b266-8315efa7bd2e
        phase: Running
        providerStatus:
          conditions:
          - lastTransitionTime: "2025-05-28T10:00:20Z"
            message: Machine successfully created
            reason: MachineCreationSucceeded
            status: "True"
            type: MachineCreation
          instanceId: i-0030eec51e080ada3
          instanceState: running
        synchronizedGeneration: 2
      liuhuali@Lius-MacBook-Pro huali-test % 

      Actual results:

          mapi machine create success, authoritativeAPI is set to MachineAPI

      Expected results:

          authoritativeAPI should be set to ClusterAPI

      Additional info:

          must-gather: https://drive.google.com/file/d/10TakwYAlZgPCrEBcQzo3364J1C8NUQeC/view?usp=sharing
      
          enhancement: https://drive.google.com/file/d/1H7laPha5P0Z_F3K4jDlqinCllCUhztKQ/view?usp=sharing

              raryan@redhat.com Rachel Ryan
              huliu@redhat.com Huali Liu
              None
              None
              Huali Liu Huali Liu
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: