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 bug in JSON path parser where an error occurs when a range is empty #95933

Merged
merged 1 commit into from Nov 3, 2020

Conversation

brianpursley
Copy link
Member

@brianpursley brianpursley commented Oct 27, 2020

What type of PR is this?
/kind bug

What this PR does / why we need it:
Fix bug in JSON path parser where an error occurs when a range is empty.

The problem was that if the range contained no results, the position of the parser loop was not advanced to the end node, so when it reached the end node in the loop it seemed like there was no open range.

The fix is to make sure even if there are not results in the range, that it still advances to the end node as if it had processed something.

(BTW, this whole file seems sort of fragile and hard to conceptualize due to all the counters that are used across functions. Seems like there should be some opportunity to improve this, but that is for another time)

Which issue(s) this PR fixes:
Fixes #95882

Special notes for your reviewer:
This probably needs to be cherry-picked back to 1.19, where the problem was introduced.

Does this PR introduce a user-facing change?:

Fix a regression in 1.19 in JSON path parser where an error occurs when a range is empty

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


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 27, 2020
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 27, 2020
@brianpursley
Copy link
Member Author

/retest

@roycaihw
Copy link
Member

/assign @caesarxuchao
/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 29, 2020
@brianpursley
Copy link
Member Author

  • Fixed typo in comment

@caesarxuchao
Copy link
Member

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brianpursley, caesarxuchao

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 Nov 3, 2020
@caesarxuchao
Copy link
Member

@brianpursley can you make a cherry-pick to 1.19? Thanks.

@k8s-ci-robot k8s-ci-robot merged commit cd99c63 into kubernetes:master Nov 3, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.20 milestone Nov 3, 2020
k8s-ci-robot added a commit that referenced this pull request Nov 17, 2020
…#95933-upstream-release-1.19

Automated cherry pick of #95933: Fix bug in JSON path parser where an error occurs when a
@liggitt liggitt added the kind/regression Categorizes issue or PR as related to a regression from a prior release. label Apr 26, 2022
@brianpursley brianpursley deleted the kubernetes-95882 branch February 2, 2023 01: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. kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. 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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSONpath support: change in behaviour over versions
5 participants