Skip to content

✨ 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

Merged
merged 1 commit into from
Nov 6, 2019

Conversation

tahsinrahman
Copy link
Contributor

@tahsinrahman tahsinrahman commented Oct 31, 2019

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

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 31, 2019

machine.Labels[clusterv1.MachineSetLabelName] = machineSet.Name
if md := metav1.GetControllerOf(machineSet); md != nil {
machine.Labels[clusterv1.MachineDeploymentLabelName] = md.Name
Copy link
Member

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?

Copy link
Contributor Author

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 :(

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vincepri @detiber i've updated the pr, PTAL if it looks right :) thanks!

@tahsinrahman tahsinrahman marked this pull request as ready for review November 1, 2019 15:45
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 1, 2019
@@ -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

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated! thanks!

@vincepri
Copy link
Member

vincepri commented Nov 1, 2019

LGTM @detiber ?

Copy link
Member

@vincepri vincepri left a 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

@k8s-ci-robot k8s-ci-robot added this to the v0.3.0 milestone Nov 1, 2019
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 1, 2019
Copy link
Contributor

@chuckha chuckha left a 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

@tahsinrahman
Copy link
Contributor Author

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

@chuckha it fixes #1695 , updated pr description

@vincepri
Copy link
Member

vincepri commented Nov 6, 2019

/assign @detiber @ncdc

for final lgtm

@detiber
Copy link
Member

detiber commented Nov 6, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 6, 2019
@k8s-ci-robot k8s-ci-robot merged commit 0f34af0 into kubernetes-sigs:master Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apply labels to Machines if they're part of a MD or MS
6 participants