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

quick fix of decoding error for BOOKMARK event #234

Merged
merged 1 commit into from
Apr 13, 2021

Conversation

yliaog
Copy link
Contributor

@yliaog yliaog commented Apr 13, 2021

Fixes kubernetes-client/python#1404

Fixed a decoding error for BOOTMARK watch events

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yliaog

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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 13, 2021
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 13, 2021
@yliaog
Copy link
Contributor Author

yliaog commented Apr 13, 2021

/assign @roycaihw

event = w.unmarshal_event(
'{"type":"BOOKMARK","object":{"kind":"Job","apiVersion":"batch/v1"'
',"metadata":{"resourceVersion":"1"},"spec":{"template":{'
'"metadata":{},"spec":{"containers":null}}},"status":{}}}',
Copy link
Member

Choose a reason for hiding this comment

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

nit: reading the doc, it looks like a bookmark event won't contain things like job spec and job status.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's correct, the spec and status are all empty, even though they seem to contain something.

Copy link
Member

Choose a reason for hiding this comment

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

I thought the key would be omitted, but maybe that's the wrong impression the doc gave me

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is not. kubernetes-client/python#1404 has the BOOKMARK event:

{"type":"BOOKMARK","object":{"kind":"Job","apiVersion":"batch/v1","metadata":{"resourceVersion":"45398385","creationTimestamp":null},"spec":{"template":{"metadata":{"creationTimestamp":null},"spec":{"containers":null}}},"status":{}}}

@roycaihw
Copy link
Member

/lgtm

https://kubernetes.io/docs/reference/using-api/api-concepts/#watch-bookmarks

I'm not familiar with this feature and don't know how it's supposed to be used. If we find a use case in this client maybe we should open a feature request to support it.

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 13, 2021
@k8s-ci-robot k8s-ci-robot merged commit e514f69 into kubernetes-client:master Apr 13, 2021
@roycaihw roycaihw added the kind/bug Categorizes issue or PR as related to a bug. label Apr 20, 2021
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. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Watch bookmarks don't work for job resources (deserialization error)
3 participants