Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Update github.com/evanphx/json-patch to version v5.0.0 #91622

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

Closed
wants to merge 1 commit into from

Conversation

tapih
Copy link
Contributor

@tapih tapih commented Jun 1, 2020

Signed-off-by: Hiroshi Muraoka h.muraoka714@gmail.com

What type of PR is this?
/kind bug

What this PR does / why we need it:
This PR fixes the bug that JSON patch with kubectl apply has exponential time complexity for the nesting depth of manifest.

Which issue(s) this PR fixes:
Fixes #91615 .

Special notes for your reviewer:

  • I read the code diff of evanphx/json-patch, and checked there was no breaking change.
  • I confirmed that a deeply nested CRD resource could be updated with kubectl apply -f https://gist.githubusercontent.com/tapih/f339a2d558cf49b0cd6320b7b2f1821b/raw/2fa11c4935f1976059c6517caef647115e1dcbda/crd.yaml on a v1.17.2 cluster created with kind.
  • github.com/evanphx/json-patch => github.com/evanphx/json-patch v4.2.0+incompatible still exists in the replace block in go.mod.
    I suppose that this is because sigs.k8s.io/kustomize still imports github.com/evanphx/json-patch.

Does this PR introduce a user-facing change?:

JSON patch implemented by https://github.com/evanphx/json-patch now conforms to RFC6902 replacement semantics and does not accept "replace" patch operations if the specified path does not exist.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jun 1, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @tapih!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @tapih. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 1, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tapih
To complete the pull request process, please assign lavalamp
You can assign the PR to them by writing /assign @lavalamp in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added area/apiserver area/cloudprovider area/dependency Issues or PRs related to dependency changes area/kubectl area/test sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jun 1, 2020
@k8s-ci-robot k8s-ci-robot requested review from andrewsykim, caesarxuchao and a team June 1, 2020 08:20
@k8s-ci-robot k8s-ci-robot added sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Jun 1, 2020
@BenTheElder
Copy link
Member

/ok-to-test
/cc @liggitt

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jun 1, 2020
@k8s-ci-robot k8s-ci-robot requested a review from liggitt June 1, 2020 17:34
@tapih
Copy link
Contributor Author

tapih commented Jun 11, 2020

I rebased this branch with the master.
What's the next step??

@liggitt
Copy link
Member

liggitt commented Jun 11, 2020

I think we should first try updating master to the SHA we intend to backport (e83c0a1c26c884f8ec4fb743f6db92a941f605f1). That can be done in a separate PR. Once that is in and backported, we can pick this back up and consider the implications of the RFC fix / compatibility break.

@k8s-ci-robot
Copy link
Contributor

@tapih: PR needs rebase.

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 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 17, 2020
@kramvan1
Copy link

@liggitt How to track the back ports for this one? And will it go back to 1.16, 1.17, 1.18?

@liggitt
Copy link
Member

liggitt commented Jun 22, 2020

@liggitt How to track the back ports for this one? And will it go back to 1.16, 1.17, 1.18?

#92069 (comment) is what will be backported. The backport PRs will be linked to that PR

@kramvan1
Copy link

@liggitt Thx for the response.

@neolit123
Copy link
Member

/remove-sig cluster-lifecycle

@k8s-ci-robot k8s-ci-robot removed the sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. label Sep 3, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 2, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 1, 2021
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closed this PR.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

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.

kersten added a commit to kersten/controller-runtime that referenced this pull request Mar 6, 2025
Maintain json-patch v4 to align with Kubernetes code and avoid breaking
changes in v5. This ensures compatibility and stability as the fake client
code is adapted from client-go's testing fixture, which relies on v4.

See:
  - kubernetes/kubernetes#91622
  - kubernetes/kubernetes#120326
kersten added a commit to kersten/controller-runtime that referenced this pull request Mar 6, 2025
Maintain json-patch v4 to align with Kubernetes code and avoid breaking
changes in v5. This ensures compatibility and stability as the fake client
code is adapted from client-go's testing fixture, which relies on v4.

See:
  - kubernetes/kubernetes#91622
  - kubernetes/kubernetes#120326
godwinpang pushed a commit to godwinpang/controller-runtime that referenced this pull request May 23, 2025
Maintain json-patch v4 to align with Kubernetes code and avoid breaking
changes in v5. This ensures compatibility and stability as the fake client
code is adapted from client-go's testing fixture, which relies on v4.

See:
  - kubernetes/kubernetes#91622
  - kubernetes/kubernetes#120326
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apiserver area/cloudprovider area/code-generation area/dependency Issues or PRs related to dependency changes area/kubectl area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

JSON patch with kubectl has exponential time complexity for nesting depth of manifest
Morty Proxy This is a proxified and sanitized view of the page, visit original site.