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

When authoritativeAPI is ClusterAPI, update mapi machineset to add new labels, the labels will not be removed

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • Low
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

      When authoritativeAPI is ClusterAPI, update mapi machineset to add new labels, the labels will not be removed from mapi machineset.
      
      If add new annotations to mapi machineset, it will be removed. 

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

      4.20.0-0.nightly-2025-06-20-214016    

      How reproducible:

      Always

      Steps to Reproduce:

      1. Create a new mapi machineset with authoritativeAPI: ClusterAPI
      2. Add labels/annotations to mapi machineset spec.template.spec.metadata
          spec:
            authoritativeAPI: ClusterAPI
            lifecycleHooks: {}
            metadata:       
              annotations:
                anno1: anno1
              labels:
                label1: label1
      3. Check mapi machineset labels/annotations
      $ oc get machineset.m zhsunaws-lwwcm-worker1 -o yaml      
          spec:
            authoritativeAPI: ClusterAPI
            lifecycleHooks: {}
            metadata:
              labels:
                label1: label1
                machine.openshift.io/cluster-api-cluster: zhsunaws-lwwcm
                machine.openshift.io/cluster-api-machineset: zhsunaws-lwwcm-worker1
                node-role.kubernetes.io/worker: ""
            providerSpec:     

      Actual results:

      The labels will not be removed from mapi machineset.    

      Expected results:

      The labels can be removed from mapi machineset.

      Additional info:

      must-gather: https://drive.google.com/file/d/1H47W_r4bFfp-qxSXIyWYxxquhgl3S4pJ/view?usp=sharing 
      related machineset: zhsunaws-mnb7m-worker3 

              rhn-gps-mbooth Matthew Booth
              rhn-support-zhsun Zhaohua Sun
              None
              None
              Zhaohua Sun Zhaohua Sun
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: