Repository navigation
Conversation
|
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 |
It is significant because we don't know who's using this. |
The changes are listed as follows: The first two aren’t changes. The last one is fine because comparable is a superset of ordered, so any existing |
|
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 |
|
/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:
You can:
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:
You can:
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:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
93a9af8 to
9ec58aa
Compare
|
New changes are detected. LGTM label has been removed. |
9ec58aa to
9156a7c
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: logicalhan, skitt 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 |
|
The The change it’s complaining about is the last one, which percolates up through the stack. But in practice I don’t think it’s a breaking API change: current code using |
|
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 |
|
/remove-lifecycle stale |
| @@ -17,19 +17,21 @@ limitations under the License. | |||
| package set | |||
There was a problem hiding this comment.
The main obstacle for transitioning from k8s.io/apimachinery/pkg/util/sets to k8s.io/utils/set: the former uses plural and thus code has sets.New, the latter singular and thus would have to change imports to sets "k8s.io/utils/set" (ugly!) or change the code (also ugly!).
"set" is arguably the better name (there's only one set type here). Also, these files have all the commit history. Maybe we can create a mirror package k8s.io/utils/sets with a typedef Set = set.Set and function wrappers for the few functions here (New, List, KeySet)?
There was a problem hiding this comment.
I’ve been checking this by migrating all of k/k, and it is indeed very helpful to have a sets package.
The major remaining wrinkle is List() but we can migrate that in k/k first (method to function).
There was a problem hiding this comment.
Another angle for a future transition: a sets type is coming to Go. Maybe we should wait for that and use it instead of our own two copies?
There was a problem hiding this comment.
Yes, that’s my plan now.
/close
|
|
||
| // KeySet creates a Set[E] from a keys of a map[E](? extends interface{}). | ||
| func KeySet[E ordered, A any](theMap map[E]A) Set[E] { | ||
| // If the value passed in is not actually a map, this will panic. |
There was a problem hiding this comment.
Okay, I bite: how can theMap not be a map?
There was a problem hiding this comment.
Good point, I’d blindly copied that from apimachinery but it is indeed meaningless!
|
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 |
9ae1dad to
782eab1
Compare
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. Signed-off-by: Stephen Kitt <[email protected]>
This should facilitate the apimachinery migration. Signed-off-by: Stephen Kitt <[email protected]>
Go 1.21+ provides cmp.Ordered which serves the same purpose as set's private ordered type. Signed-off-by: Stephen Kitt <[email protected]>
782eab1 to
01618ee
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: logicalhan, skitt 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 |
|
#361 takes care of the |
|
@skitt: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
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: