-
Notifications
You must be signed in to change notification settings - Fork 62
Non-stable ordering #289
Comments
Can you share a few details about which objects are moving around? What are their GVKs, namespaces, and names? kubecfg takes these details into consideration for sorting objects. It alphabetizes by namespace, name, and object kind. If for some reason your API was changing the OpenAPI schema it serves, changing details like whether a resource is namespaced or not, I could see this order jumping around. |
Here is my example:
where
All manifests are in the same namespace. All names are distinct. Issues: |
Thank you for the detailed example. What is the name of the VirtualService? Did it change between these two invocations? |
The names didn't change (otherwise the change would have appeared in the diff). |
What is the name of the VirtualService? |
Here is the entire file:
|
Ah, now I see what's wrong: only the delete and update subcommands sort the objects. In your case, presumably running show, you're falling prey to the the JSON reader's use of map iteration, which we know is deliberately unspecified and variable. Thank you for providing the additional detail along the way. |
Yes, I am using the show subcommand. I implement GitOps. I use kubecfg to generate the manifests. |
We should fix that and have "show" behave like update |
When one uses kubecfg to generate manifests (instead of directly writing them to Kubernetes), the order of manifests is unstable. This makes it difficult to track changes.
This problem occurs when serializing objects, not lists.
Please make the serialization order stable. Any order is fine, as long as it is stable.
The text was updated successfully, but these errors were encountered: