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

🐛 Fix returning object after status update #2489

Merged
merged 3 commits into from Sep 10, 2023
Merged

🐛 Fix returning object after status update #2489

merged 3 commits into from Sep 10, 2023

Conversation

alvaroaleman
Copy link
Member

Prior to this, we overwrote the passed in pointer to obj on status update, which means that the caller can never see the updated object after the call. This changes makes us instead overwrite the value behind the pointer, so that it gets propagated back to the caller.

@berlin-ab I like this approach more, as it seems a bit simpler and keeps the changed contained to the place that causes the need for them. WDYT?

/cc @berlin-ab @troy0820

Superseeds #2486
Fixes #2487

@k8s-ci-robot
Copy link
Contributor

@alvaroaleman: GitHub didn't allow me to request PR reviews from the following users: berlin-ab.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

Prior to this, we overwrote the passed in pointer to obj on status update, which means that the caller can never see the updated object after the call. This changes makes us instead overwrite the value behind the pointer, so that it gets propagated back to the caller.

@berlin-ab I like this approach more, as it seems a bit simpler and keeps the changed contained to the place that causes the need for them. WDYT?

/cc @berlin-ab @troy0820

Superseeds #2486
Fixes #2487

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.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 10, 2023
@alvaroaleman alvaroaleman added tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 10, 2023
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 10, 2023
@troy0820
Copy link
Member

@alvaroaleman this makes sense and also behaves as expected.
Testing errors but otherwise,
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 10, 2023
@berlin-ab
Copy link
Contributor

berlin-ab commented Sep 10, 2023 via email

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Sep 10, 2023
@alvaroaleman
Copy link
Member Author

/cherrypick release-0.16

@k8s-infra-cherrypick-robot

@alvaroaleman: once the present PR merges, I will cherry-pick it on top of release-0.16 in a new PR and assign it to you.

In response to this:

/cherrypick release-0.16

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.

@troy0820
Copy link
Member

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, troy0820

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 merged commit 422c831 into main Sep 10, 2023
9 checks passed
@k8s-infra-cherrypick-robot

@alvaroaleman: new pull request created: #2490

In response to this:

/cherrypick release-0.16

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.

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. 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. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The fake client should be able to cl.Update(...) an object after calling cl.Status().Update(...)
5 participants