-
Notifications
You must be signed in to change notification settings - Fork 185
quick fix of decoding error for BOOKMARK event #234
Conversation
[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 |
/assign @roycaihw |
event = w.unmarshal_event( | ||
'{"type":"BOOKMARK","object":{"kind":"Job","apiVersion":"batch/v1"' | ||
',"metadata":{"resourceVersion":"1"},"spec":{"template":{' | ||
'"metadata":{},"spec":{"containers":null}}},"status":{}}}', |
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.
nit: reading the doc, it looks like a bookmark event won't contain things like job spec and job status.
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.
that's correct, the spec and status are all empty, even though they seem to contain something.
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 thought the key would be omitted, but maybe that's the wrong impression the doc gave me
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 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":{}}}
/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. |
Fixes kubernetes-client/python#1404