-
Notifications
You must be signed in to change notification settings - Fork 2.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
Bugfix: MachineInfo Clone() to also clone "SwapCapacity" #3293
Bugfix: MachineInfo Clone() to also clone "SwapCapacity" #3293
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Hi @iholder101. Thanks for your PR. I'm waiting for a google member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
PR for the fix at upstream cAdvisor: google/cadvisor#3293 Signed-off-by: Itamar Holder <[email protected]>
/ok-to-test |
closing and reopening to recalculate CLA |
@iholder101 can you please sign CLA? |
Would you be OK writing a small unit test for the |
Yes, I'm currently waiting for answers regarding what's the right way to do so.
Of course! Will do soon |
Signed-off-by: Itamar Holder <[email protected]>
cd3c6bd
to
6e37e97
Compare
Hey @SergeyKanzhelev! I've added a unit test. For example, if I avoid populating === RUN TestMachineInfoClone
machine_test.go:31:
Error Trace: cadvisor/info/v1/machine_test.go:31
Error: Should be false
Test: TestMachineInfoClone
Messages: field SwapCapacity is not populated
--- FAIL: TestMachineInfoClone (0.00s) |
6e37e97
to
183a259
Compare
/lgtm |
Add a unit test that ensures that Clone() method clones all fields and that the cloned struct equals the original. To avoid missing fields in the future, the test fails if one of the struct's fields is populated with a zero-value. The unit test uses reflection to achieve that. Signed-off-by: Itamar Holder <[email protected]>
183a259
to
9dfa5dc
Compare
Hey @SergeyKanzhelev! Thanks for the review and LGTM. |
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.
/approve
/lgtm
PR for the fix at upstream cAdvisor: google/cadvisor#3293 Signed-off-by: Itamar Holder <[email protected]>
PR for the fix at upstream cAdvisor: google/cadvisor#3293 When a release comes out it would be possible to bump cadvisor's version and get rid of this commit, which is intended to be temporary. Signed-off-by: Itamar Holder <[email protected]>
@dims can we consider an out-of-cycle (or pulled up) release of cadvisor in order to increase the chances for swap to land in Kube? |
@fabiand i am supportive, @bobbypage is the one who does releases, so please check with him. |
Thanks @dims |
Gentle ping. @bobbypage :) |
PR for the fix at upstream cAdvisor: google/cadvisor#3293 When a release comes out it would be possible to bump cadvisor's version and get rid of this commit, which is intended to be temporary. Signed-off-by: Itamar Holder <[email protected]>
@Creatone helped to cut a new v0.47.3 release with the bug fix and kubernetes/kubernetes#119225 will bump the dependency. Thanks all! |
This PR fixes a small bug in MachineInfo's Clone() method.
Today,
SwapCapacity
is not being cloned, therefore after cloning it is being set to 0.