k8s
k8s copied to clipboard
Store and send resourceVersion in watch_list/watcher
The watch loop in Watcher should send the newest resourceVersion it has seen when restarting the watch connection to reduce pressure on the apiserver. See https://kubernetes.io/docs/reference/using-api/api-concepts/#efficient-detection-of-changes for suggested behavior.
This mechanism should probably be extended to support the watch bookmark feature (https://kubernetes.io/docs/reference/using-api/api-concepts/#watch-bookmarks) if available (since Kubernetes 1.16).
Watch bookmark KEP: https://github.com/kubernetes/enhancements/blob/239b0c8cc09895b63151806251d7f6c2d2c3aa2f/keps/sig-api-machinery/20190206-watch-bookmark.md