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
Conversation
@@ -312,6 +312,20 @@ func (c *controller) updateMachineState(machine *v1alpha1.Machine) (*v1alpha1.Ma | |||
if err != nil { | |||
return machine, err | |||
} | |||
|
|||
if clone.Labels == nil { |
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 need to take a deepCopy before making the changes 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.
thanks, I wasn't really sure to deep-copy here. We can certainly deep-copy, do you have any possible reasoning to support it?
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.
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.
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.
As discussed over a call, made few changes.
Thanks, this was a good catch..
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.
Looks good now.
a634053
to
bf24ddd
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.
/lgtm
@@ -312,6 +312,20 @@ func (c *controller) updateMachineState(machine *v1alpha1.Machine) (*v1alpha1.Ma | |||
if err != nil { | |||
return machine, err | |||
} | |||
|
|||
if clone.Labels == nil { |
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.
Looks good now.
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: