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

🌱 machinedeployment: set revision on machinedeployment and patch via defer #10160

Merged

Conversation

chrischdi
Copy link
Member

What this PR does / why we need it:

This is a follow-up from: https://github.com/kubernetes-sigs/cluster-api/pull/10124/files#r1484483425

This code recently got changed in this PR: https://github.com/kubernetes-sigs/cluster-api/pull/10124/files#diff-d9a80cabbd6ae2ad7412b4e57a7f3d474b4816a021e4b84987c0895c6b1189c6R117

Before that, when calling r.updateMachineDeployment did never make any sense, because inside the anonymous function we never passed through the variable from the function, but our global machinedeployment instead.

So technically we already always used patching using defer instead of immediately patching the object.

There also seems to be no race when patching in defer, because the annotation gets never read from the machinedeployment. (We read it from machinesets).

cc @sbueringer

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 #

/area machinedeployment

@k8s-ci-robot k8s-ci-robot added area/machinedeployment Issues or PRs related to machinedeployments cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 15, 2024
@chrischdi chrischdi changed the title machinedeployment: set revision on machinedeployment and patch via defer 🌱 machinedeployment: set revision on machinedeployment and patch via defer Feb 15, 2024
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 15, 2024
@sbueringer
Copy link
Member

Thank you!

/lgtm

/assign @fabriziopandini @vincepri

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 15, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 33354910467d9c416546f648f06628ad38f26340

@chrischdi
Copy link
Member Author

/assign @fabriziopandini

:-)

@chrischdi
Copy link
Member Author

/assign @fabriziopandini

@fabriziopandini
Copy link
Member

nice cleanup!
/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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 Feb 26, 2024
@k8s-ci-robot k8s-ci-robot merged commit b5a78b8 into kubernetes-sigs:main Feb 26, 2024
26 of 27 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.7 milestone Feb 26, 2024
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. area/machinedeployment Issues or PRs related to machinedeployments 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.

None yet

5 participants