utils
utils copied to clipboard
Align set with k/k apimachinery
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This aligns the features of generic Set with the version in apimachinery. The main change is that sets can be instantiated with any comparable type, not only ordered types; as a result, SortedList() can no longer be implemented as a method, and is replaced by the List() function to match apimachinery.
Which issue(s) this PR fixes: Fixes #
Special notes for your reviewer:
Release note:
sets.Set accepts any comparable type; the sets.SortedList method is replaced with a sets.List function, to match the apimachinery implementation, and to allow unordered sets to be converted to ordered slices.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: logicalhan, skitt
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~set/OWNERS~~ [logicalhan]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Thanks @logicalhan! There’s a failure in apidiff but I don’t think it’s significant — the changes are expected (or bugs in apidiff).
/hold
Thanks @logicalhan! There’s a failure in apidiff but I don’t think it’s significant — the changes are expected (or bugs in apidiff).
It is significant because we don't know who's using this.
It is significant because we don't know who's using this.
The changes are listed as follows:
- KeySet: changed from func(map[E]A) Set[E] to func(map[E]A) Set[E]
- New: changed from func(...E) Set[E] to func(...E) Set[E]
- Set: changed from Set[E ordered] to Set[E comparable]
The first two aren’t changes. The last one is fine because comparable is a superset of ordered, so any existing Set will still build.
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle stale - Close this PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle stale - Close this PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle stale - Close this PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale