Skip to content
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

Bugfix: Existing machine-object now adopts node-label #265

Merged
merged 1 commit into from May 13, 2019

Conversation

hardikdr
Copy link
Member

What this PR does / why we need it:
We realized existing machine-objects were not picking up the node-label. This PR fixes that bug.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

Bugfix: Existing machine-objects now adopts the node-label.

@hardikdr hardikdr requested review from ggaurav10 and a team as code owners May 12, 2019 19:08
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels May 12, 2019
@prashanth26 prashanth26 added area/robustness Robustness, reliability, resilience related component/machine-controller-manager kind/bug Bug kind/regression Bug that hit us already in the past and that is reappearing/requires a proper solution priority/critical Needs to be resolved soon, because it impacts users negatively size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) status/external-action Issue has external dependency topology/seed Affects Seed clusters labels May 12, 2019
@prashanth26 prashanth26 added this to the 1904b milestone May 13, 2019
@@ -312,6 +312,20 @@ func (c *controller) updateMachineState(machine *v1alpha1.Machine) (*v1alpha1.Ma
if err != nil {
return machine, err
}

if clone.Labels == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to take a deepCopy before making the changes here?

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, I wasn't really sure to deep-copy here. We can certainly deep-copy, do you have any possible reasoning to support it?

Copy link
Contributor

Choose a reason for hiding this comment

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

From what I understand, we would be working from an object from the local cache directly. if we don't deep copy. Deep copying creates a local copy on this method and then acts on it.

Copy link
Member Author

Choose a reason for hiding this comment

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

As discussed over a call, made few changes.
Thanks, this was a good catch..

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good now.

Copy link
Contributor

@prashanth26 prashanth26 left a comment

Choose a reason for hiding this comment

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

/lgtm

@@ -312,6 +312,20 @@ func (c *controller) updateMachineState(machine *v1alpha1.Machine) (*v1alpha1.Ma
if err != nil {
return machine, err
}

if clone.Labels == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good now.

@prashanth26 prashanth26 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels May 13, 2019
@gardener-robot-ci-1 gardener-robot-ci-1 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels May 13, 2019
@prashanth26 prashanth26 merged commit b8b56a5 into gardener:master May 13, 2019
@ghost ghost added the component/mcm Machine Controller Manager (including Node Problem Detector, Cluster Auto Scaler, etc.) label Mar 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/robustness Robustness, reliability, resilience related component/mcm Machine Controller Manager (including Node Problem Detector, Cluster Auto Scaler, etc.) kind/bug Bug kind/regression Bug that hit us already in the past and that is reappearing/requires a proper solution needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) priority/critical Needs to be resolved soon, because it impacts users negatively size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) status/external-action Issue has external dependency topology/seed Affects Seed clusters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants