Closed Stono closed 4 years ago
Following on from https://github.com/godaddy/kubernetes-client/issues/633, when we are reconnecting the kubernetes client we need to pass the resourceVersion of the last item we saw (https://kubernetes.io/docs/reference/using-api/api-concepts/)
resourceVersion
However, when you do that with this client, eg:
watch.getObjectStream({ qs: { resourceVersion: 1 } })
The stream just immediately emits close event, with no context, so its impossible to see why it closed.
close
It's important we can see the close reason because if the code is 410, we need to restart with a different resourceVersion.
code
410
If you add a callback to: https://github.com/godaddy/kubernetes-client/blob/master/backends/request/client.js#L225 - you can see the 410 in the response body:
body: { type: 'ERROR', object: { kind: 'Status', apiVersion: 'v1', metadata: {}, status: 'Failure', message: 'too old resource version: 1 (226181910)', reason: 'Gone', code: 410 }
Closing as i realised this is being emitted through the on('data') event.
on('data')
Following on from https://github.com/godaddy/kubernetes-client/issues/633, when we are reconnecting the kubernetes client we need to pass the
resourceVersion
of the last item we saw (https://kubernetes.io/docs/reference/using-api/api-concepts/)However, when you do that with this client, eg:
The stream just immediately emits
close
event, with no context, so its impossible to see why it closed.It's important we can see the close reason because if the
code
is410
, we need to restart with a different resourceVersion.If you add a callback to: https://github.com/godaddy/kubernetes-client/blob/master/backends/request/client.js#L225 - you can see the 410 in the response body: