-
Notifications
You must be signed in to change notification settings - Fork 3k
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
identity: make GetAllReservedIdentities()
return ordered identities
#20048
identity: make GetAllReservedIdentities()
return ordered identities
#20048
Conversation
24724cc
to
e1a630c
Compare
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.
Looks good, but it looks to me this function is not used for anything, so maybe we should just delete it instead?
e1a630c
to
5e7be46
Compare
@jrajahalme correct it is unused in this repo, but the Hubble CLI uses it (see the PR's description for a link to the relevant code). I've added a comment so that it doesn't get removed. |
Before this patch, the returned slice from GetAllReservedIdentities() was inconsistently ordered. This was caused by the fact that the resulting slice is built from iterating over a go map, and "the iteration order over maps is not specified and is not guaranteed to be the same from one iteration to the next. […]", see the Go language spec[1]. [1]: https://go.dev/ref/spec#For_statements Signed-off-by: Alexandre Perrin <alex@isovalent.com>
As stated above, |
Now that we vendor a version of Cilium including cilium/cilium#20048 identity.GetAllReservedIdentities() consistently returned a sorted list already. Signed-off-by: Alexandre Perrin <alex@isovalent.com>
Now that we vendor a version of Cilium including cilium/cilium#20048 identity.GetAllReservedIdentities() consistently returned a sorted list already. Signed-off-by: Alexandre Perrin <alex@isovalent.com>
Before this patch, the returned slice from
GetAllReservedIdentities()
was inconsistently ordered.This was caused by the fact that the resulting slice is built from iterating over a go map, and "the iteration order over maps is not specified and is not guaranteed to be the same from one iteration to the next. […]", see the Go language spec.
See cilium/hubble#732 for more context.