Skip to content
This repository has been archived by the owner on Mar 13, 2022. It is now read-only.

Fixed Watch.unmarshal_event when data is not a JSON-serialized object #171

Merged
merged 1 commit into from
Feb 21, 2020

Conversation

Ark-kun
Copy link
Contributor

@Ark-kun Ark-kun commented Oct 18, 2019

Log streaming using Watch was introduced in #93, but the users faced errors when the log line was a single number or an empty string.
This PR fixes those issues.

Fixes kubernetes-client/python#982
Fixes kubernetes-client/python#983

@k8s-ci-robot
Copy link
Contributor

Welcome @Ark-kun!

It looks like this is your first PR to kubernetes-client/python-base 🎉. 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-client/python-base 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 k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 18, 2019
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 18, 2019
@codecov-io
Copy link

Codecov Report

Merging #171 into master will decrease coverage by 0.06%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #171      +/-   ##
==========================================
- Coverage   93.41%   93.35%   -0.07%     
==========================================
  Files          13       13              
  Lines        1398     1400       +2     
==========================================
+ Hits         1306     1307       +1     
- Misses         92       93       +1
Impacted Files Coverage Δ
watch/watch.py 98.82% <50%> (-1.18%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b65461...f11587d. Read the comment docs.

@roycaihw
Copy link
Member

/cc @jiahuif

@k8s-ci-robot
Copy link
Contributor

@roycaihw: GitHub didn't allow me to request PR reviews from the following users: jiahuif.

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

In response to this:

/cc @jiahuif

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.

@jiahuif
Copy link

jiahuif commented Oct 23, 2019

As discussed here kubernetes-client/python#982 (comment)

If the object has a field named "object", the fix would not work. We should not rely on one of the field to determine the type.

@Ark-kun
Copy link
Contributor Author

Ark-kun commented Oct 24, 2019

If the object has a field named "object", the fix would not work. We should not rely on one of the field to determine the type.

Unfortunately, dictionaries are duck-typed by design.
The code in question insists on accessing the 'object' key.
Without the fix, the code is randomly broken in large number of cases.

Can you please suggest another way to fix the common path?

@scottilee
Copy link

@jiahuif any update for @Ark-kun ?

@jiahuif
Copy link

jiahuif commented Dec 26, 2019

@kvalev
Copy link

kvalev commented Jan 15, 2020

Log streaming using Watch was introduced in #93, but the users faced errors when the log line was a single number or an empty string.

Also when the log line represents an empty array [], like we just had.

@roycaihw
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 21, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Ark-kun, roycaihw

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 Feb 21, 2020
@k8s-ci-robot k8s-ci-robot merged commit 7e7976b into kubernetes-client:master Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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 Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
7 participants