-
Notifications
You must be signed in to change notification settings - Fork 208
Migrate google/btree to k8s util #336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Migrate google/btree to k8s util #336
Conversation
|
Welcome @pjsharath28! |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pjsharath28 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 |
| // In Go 1.18 and beyond, a BTreeG generic is created, and BTree is a specific | ||
| // instantiation of that generic for the Item interface, with a backwards- | ||
| // compatible API. Before go1.18, generics are not supported, | ||
| // and BTree is just an implementation based around the Item interface. | ||
|
|
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.
This isn’t relevant and should be removed.
| // There are two implementations; those suffixed with 'G' are generics, usable | ||
| // for any type, and require a passed-in "less" function to define their ordering. | ||
| // Those without this prefix are specific to the 'Item' interface, and use | ||
| // its 'Less' function for ordering. |
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.
k/k only uses the generic implementation, do we need to keep both in utils?
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
The
github.com/google/btreelibrary used by k8s and etcd has been archived and is no longer maintained. This raises long-term concerns around security fixes and CVEs.We discussed multiple options to address this in the issue. Given that we only rely on a single source file from the library, we concluded that copying the code into
k8s.io/utilsis the simplest option. This avoids introducing or maintaining a separate fork while preserving identical behaviour.Which issue(s) this PR is related to:
Discussion issue: etcd-io/etcd#20991
Special notes for your reviewer:
Upstream Google attribution is preserved and the file header follows Kubernetes conventions while remaining Apache-2.0 compliant.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: