-
Notifications
You must be signed in to change notification settings - Fork 3.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
add JSON Patch support for namespaced custom objects #2040
Conversation
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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. |
|
Welcome @iTaybb! |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: iTaybb The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -2548,7 +2548,7 @@ def patch_cluster_custom_object_with_http_info(self, group, version, plural, nam | |||
|
|||
# HTTP header `Content-Type` | |||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 | |||
['application/merge-patch+json']) # noqa: E501 | |||
['application/json-patch+json' if isinstance(body, list) else 'application/merge-patch+json']) # noqa: E501 |
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.
is the change backwards compatible? This file is generated by openapi-generator, and we already carry a patch to make sure merge patch is used for custom objects:
python/scripts/apply-hotfixes.sh
Line 30 in 56eea10
# Ref: https://github.com/kubernetes-client/python/pull/995/commits/9959273625b999ae9a8f0679c4def2ee7d699ede |
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.
I had no idea these files were auto-generated. In that case, If I understand correctly, if this PR gets accepted, a cherry-pick to this commit will by added to the apply-hotfixes.sh
script. Is that correct?
To your question - it is backwards compatible. As discussed before, when the body patch is a dict, the application/merge-patch+json
content-type will be used, which was used in all previous versions and thus is backwards compatible.
When the body patch is a list, which indicates it contains a JSONPatch (which is a new feature, not supported before on custom objects on this library) - the content-type shall be application/json-patch+json
.
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.
It is a known issue and the solution was discussed here: #959
To solve this we need to upgrade openapi-generator to the latest versions.
This PR needs some love :) |
This also looks like a fix for my issue #2119 |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale
…On Tue, Feb 13, 2024, 10:09 Kubernetes Triage Robot < ***@***.***> wrote:
The Kubernetes project currently lacks enough contributors to adequately
respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity, lifecycle/stale is applied
- After 30d of inactivity since lifecycle/stale was applied,
lifecycle/rotten is applied
- After 30d of inactivity since lifecycle/rotten was applied, the PR
is closed
You can:
- Mark this PR as fresh with /remove-lifecycle stale
- Close this PR with /close
- Offer to help out with Issue Triage
<https://www.kubernetes.dev/docs/guide/issue-triage/>
Please send feedback to sig-contributor-experience at kubernetes/community
<https://github.com/kubernetes/community>.
/lifecycle stale
—
Reply to this email directly, view it on GitHub
<#2040 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA3SSBTRA5UA5JSDIHR4SGLYTMNTXAVCNFSM6AAAAAAWY26KW6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBQGY3TSOJSGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. 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-sigs/prow repository. |
/remove-lifecycle stale |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #2039
Special notes for your reviewer:
Does this PR introduce a user-facing change?
NONE
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: