-
Notifications
You must be signed in to change notification settings - Fork 1.4k
✨ Apply labels to Machines if they're part of a MD or MS #1711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Apply labels to Machines if they're part of a MD or MS #1711
Conversation
controllers/machineset_controller.go
Outdated
|
||
machine.Labels[clusterv1.MachineSetLabelName] = machineSet.Name | ||
if md := metav1.GetControllerOf(machineSet); md != nil { | ||
machine.Labels[clusterv1.MachineDeploymentLabelName] = md.Name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we apply this when creating the MS in machinedeployment_controller?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can do that, but I'm do not quite understand why we need to do that. Obviously I'm missing the context/background here :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to do both? A MachineSet might not be managed by a MachineDeployment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eda8f8a
to
412f930
Compare
controllers/machineset_controller.go
Outdated
@@ -384,6 +384,9 @@ func (r *MachineSetReconciler) getNewMachine(machineSet *clusterv1.MachineSet) * | |||
machine.ObjectMeta.OwnerReferences = []metav1.OwnerReference{*metav1.NewControllerRef(machineSet, machineSetKind)} | |||
machine.Namespace = machineSet.Namespace | |||
machine.Spec.ClusterName = machineSet.Spec.ClusterName | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: remove spaces around this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated! thanks!
LGTM @detiber ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
/milestone v0.3.0
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tahsinrahman, vincepri The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
412f930
to
e8437d0
Compare
e8437d0
to
9455dde
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an issue around this? I'm not really sure what this is solving. If we need this for some reason though it looks fine to me
/lgtm |
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #1695