-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
MD controller sync getNewMachineSet should not return nil as newMS after updating existingNewMS #970
Comments
@calebamiles and I looked at the code together. From the doc string of
Of course, L113 returns nil even though the new machine set does exist. But none of the machine deployment tests fail because of this. So either those tests don't catch the issue, or it's not an issue (e.g. the caller of First thing to do might be to write a test for |
@detiber, maybe a short walkthrough of the code might be helpful. don't know if it makes sense to do so before or after the general cluster api code walkthrough |
@dlipovetsky I got two examples of testing to look at |
MachineDeployment from the CAPI book: https://cluster-api.sigs.k8s.io/common_code/machinedeployment_controller.html |
/unassign |
We'll go through some redesign/refactor of these controllers in the future #, I think it's safe to close this for now. Ref: #1689 /close |
@vincepri: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/kind bug
In pkg/controller/machinedeployments/sync.go
getNewMachineSet
, when there's an existing new MS, and its annotations or minReadySeconds need to be updated, the controller update the MS and return nil as new MS, and the error from r.Update as follows:IMO it should not return nil, it should return the updated MS (msCopy).
https://github.com/kubernetes-sigs/cluster-api/blame/master/pkg/controller/machinedeployment/sync.go#L111
This was introduced in the major refactoring:
Oct 4 2019: Migrate to kubebuilder #494 (#494)
revision: 80129c0
I looked up the old code before the PR and originally the line was this:
And this is the original Update method called:
So originally newMS was the updated MS.
I don't have a concrete repro of any issue resulted from this bug, but naively this seems to me an issue to fix.
What did you expect to happen:
The controller method should return msCopy and error from r.Update(..., msCopy) instead
Anything else you would like to add:
NA
Environment:
kubectl version
): NA/etc/os-release
): NAThe text was updated successfully, but these errors were encountered: