Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: yedou37 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @yedou37! |
|
/cc @dims @serathius |
|
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds a shared revision-ordered ring buffer utility to
k8s.io/utils/buffer.The motivation comes from review feedback on kubernetes/kubernetes#138338, where the snapshot ring buffer implementation in apiserver was requested to align more closely with etcd's cache ring buffer so that the implementation can eventually be shared between Kubernetes and etcd.
The new utility:
cache/ringbuffer.goWhy this is needed:
The existing
k8s.io/utils/bufferutilities cover generic fixed-size and growing ring buffers, but they do not provide the revision-aware semantics needed by the Kubernetes snapshot storage use case, such as revision-ordered lookup and trimming by revision.Which issue(s) this PR fixes:
N/A
Special notes for your reviewer:
This utility is extracted from the ring buffer work proposed in kubernetes/kubernetes#138338.
Related etcd context:
The implementation is intended to stay close in spirit to etcd's cache ring buffer while also covering the revision-aware operations currently needed by the Kubernetes snapshot storage use case.
Release note: