Bug 2099836

Summary: MachineSet labels are not added to NEW nodes
Product: OpenShift Container Platform Reporter: okashi
Component: Cloud ComputeAssignee: Joel Speed <jspeed>
Cloud Compute sub component: Cloud Controller Manager QA Contact: sunzhaohua <zhsun>
Status: CLOSED NOTABUG Docs Contact:
Severity: medium    
Priority: low CC: eparis, nmalik
Version: 4.10Keywords: ServiceDeliveryImpact
Target Milestone: ---   
Target Release: ---   
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-08-08 15:34:40 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:
Attachments:
Description Flags
video showing the process and results none

Description okashi 2022-06-21 19:24:41 UTC
Created attachment 1891725 [details]
video showing the process and results

Description of problem:
In Azure Red Hat OpenShift (ARO) if I add a label to the machineset `spec.template.metadata.labels` the label appears in any new machines that are created from that machineset.  Are the underlying nodes of those new machines supposed to have that label too? I expect the nodes to have the label, but I am not seeing it.

Version-Release number of selected component (if applicable):
Server Version: 4.10.15
Kubernetes Version: v1.23.5+3afdacb

How reproducible:


Steps to Reproduce:
1. Deploy an ARO cluster
2. Add a label to a machineset under spec.template.metadata.labels
3. Scale the machineset up by at least one
4. Check the labels on the NEW machine (the added label should be there)
5. Check the node labels for the NEW nodes.  The Label is NOT there.

Actual results:
Node label is not on the new node.

Expected results:
Node label is on the new node.

Additional info:

Comment 1 sunzhaohua 2022-07-29 03:42:58 UTC
The label should be set to a machineset under spec.template.spec.metadata.labels
https://docs.openshift.com/container-platform/4.5/machine_management/creating_machinesets/creating-machineset-azure.html#machineset-yaml-azure_creating-machineset-azure

Comment 2 Joel Speed 2022-08-01 15:29:06 UTC
As Zhaohua has said, the labels need to be on the spec.template.spec.metadata rather than just spec.template.metadata. I don't believe there to be a bug in that logic currently as this is covered by our existing testing. Can we double check that this works as expected when adding labels to the spec.template.spec.metadata? If there's no issue here we can close this out

Comment 3 Joel Speed 2022-08-08 15:34:40 UTC
I don't believe this is a bug, if you need any further support feel free to reach out