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

⚠️ introduce PatchResponseFromRaw and drop PatchResponse #256

Merged
merged 1 commit into from
Jan 24, 2019

Conversation

mengqiy
Copy link
Member

@mengqiy mengqiy commented Dec 14, 2018

fixes kubernetes-sigs/kubebuilder#510

This PR supersedes #251.
This PR introduces PatchResponseFromRaw and drops PatchResponse.

This is a breaking change, so should released in v0.2.0.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 14, 2018
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 14, 2018
@mengqiy mengqiy requested a review from droot December 14, 2018 21:39
@mengqiy mengqiy added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 14, 2018
Copy link
Contributor

@droot droot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer this version over the other. Would like @DirectXMan12 thoughts on it.

}
}

// PatchResponse is DEPRECATED. Use PatchResponseFromRaw instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be good to highlight why is this being deprecated (may be refer to the issue which explains the roundtripping) ?

@@ -54,7 +56,23 @@ func ValidationResponse(allowed bool, reason string) types.Response {
return resp
}

// PatchResponse returns a new response with json patch.
// PatchResponseFromRaw takes 2 byte arrays and returns a new response with json patch.
func PatchResponseFromRaw(original, current []byte) types.Response {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer this over the other PR which takes three params original, current, originalRawBytes which could get confusing for the end user and also not help user avoid the round-tripping issue.

@mengqiy mengqiy removed the request for review from pwittrock December 18, 2018 00:05
@DirectXMan12
Copy link
Contributor

agree with @droot's comments.

@droot droot added this to the 0.2.0 milestone Jan 15, 2019
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 16, 2019
@mengqiy mengqiy removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 16, 2019
@mengqiy
Copy link
Member Author

mengqiy commented Jan 16, 2019

@droot @DirectXMan12 PTAL

@mengqiy mengqiy changed the title ✨ introduce patchFromRaw and deprecate patchFromObject :warn: introduce PatchResponseFromRaw and drop PatchResponse Jan 16, 2019
@mengqiy mengqiy changed the title :warn: introduce PatchResponseFromRaw and drop PatchResponse ⚠️ introduce PatchResponseFromRaw and drop PatchResponse Jan 16, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: droot, mengqiy

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 Jan 16, 2019
@mengqiy
Copy link
Member Author

mengqiy commented Jan 24, 2019

This should be ready to go.
@droot Can you apply the label?

@droot droot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 24, 2019
@k8s-ci-robot k8s-ci-robot merged commit 2aa4232 into kubernetes-sigs:master Jan 24, 2019
@mengqiy mengqiy deleted the patchfromraw branch January 24, 2019 19:21
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] mutating webhook admission failed because of wrong json patch
4 participants