-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
config_dump returns output in random order #4122
Comments
IIRC there is a way to have proto do consistent serialization but I forget the details right now and I don't have time to go poking through the code (check proto utilities). @htuch do you remember? |
I'm not sure this is possible in the presence of maps, e.g. https://gist.github.com/kchristidis/39c8b310fd9da43d515c4394c3cd9510. I think for this reason, maps should be avoided in our admin API endpoint output. |
Maps keys can be optionally sorted to make diffing easier. The question is should this be done inside the config_dump endpoint or is it better left to the client that is consuming the output. If it is not too expensive, determnistic json output is preferred. |
@mandarjog where is the option to have proto do this? I don't see it in |
Also, I'd question what value maps bring to any of our endpoint output, can someone articulate this? |
I don't think the maps add any value. I would just switch them all to lists. |
@mattklein123 assign this to me. I will work on it |
Even we make them lists, the output won't be deterministic in many places where the config is dumped from |
@lizan from the client perspective, this is unsatisfying, since we use these protos to serialize to JSON and output for humans. Humans aren't very good at comparing large unordered lists 💩 |
Right, so I would suggest use (or should we make one?) a client side tool to sort them instead of doing admin output, to keep admin endpoints lightweight. |
I'm trying to sync Istio with the latest envoy API, Is it always guaranteed that the [ cc @liamawhite |
@yangminzhu It is always guaranteed to return in the order [bootstrap, cluster, listener, routes] (lexicographic order) as documented here |
Well, there are other maps for stats (https://github.com/envoyproxy/envoy/blob/master/api/envoy/admin/v2alpha/clusters.proto#L49), but I think this is a reasonable step and we can open new issues if folks object. |
Yeah. I saw that. Let me see if I can fix that as well this week. |
Currently config_dump returns configs in random as they are defined as a map in the proto.
Is there any better way to to make output more deterministic via protos? Otherwise can we enforce some ordering while displaying?
The text was updated successfully, but these errors were encountered: