Closed MichelCarroll closed 2 years ago
I think it looks good, thanks for the contribution. I did a bit of testing locally, and then some reading of the API docs, and it seems it's expected that clients handle a "410 Gone" status from the API when sending the resourceVersion constraint in a query, as the server doesn't guarantee to know about old events:
{"type":"ERROR","object":{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"too old resource version: 1312242788 (1474332294)","reason":"Gone","code":410}}
Catching that error and setting the last_seen_version back to None should work for this. I think it would be more friendly if the library took care of this, rather than leaving it up to clients
/sem-approve
☝️ Trying to get semaphore to build the PR...
@gregjones Good point. I'll add handling for the "too old resource version" case.
@mortenlj Indeed, I'll look at Semaphore and make the adjustments you suggested.
I found your "hacktoberfest" tagged issues. I figured this was a good opportunity to learn more about the k8s API, as well as levelling up my Python skills.
@MichelCarroll : Any movement on this?
This PR is in response to #70 and #71.
I modified the
k8s.watcher
module to:Bookmark
events without forwarding them to the listenerstart_at_resource_version
parameter)Please let me know what you think.