-
Notifications
You must be signed in to change notification settings - Fork 297
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
[Suggestion] fix ordering in YAML output #17
Comments
Pointer to where we serialize to yaml: https://github.com/awslabs/cdk8s/blob/fcb81a8b32dd37ccfdbb5de018ece93b92ce84bf/packages/cdk8s/lib/chart.ts#L77 |
I'll take this! I think we can start with For the top-level, I agree with the proposed solution of:
Looking at their examples, most generally follow this (though some, like I think we can put 1-3 in that order, and after that, order from shortest to longest, and in deeper levels of definitions, follow the shortest to longest as well. As such, when you scroll down in a file, you are reading inward on levels of deepness, and are not popping back out to a higher level without seeing its context. Will poke around in the code mentioned above to find a solution. |
I would take a bit of a more simple approach: |
Fixes #17 Using [`json-stable-stringify`](https://github.com/substack/json-stable-stringify) to sort output alphabetically and recursively. Signed-off-by: campionfellin <[email protected]>
Is your feature request related to a problem? Please describe.
Synthesized YAML shows up out of order from standard K8s format. It technically works, but for a user familiar with K8s YAML formatting can be confusing to read.
example:
Describe the solution you'd like
Follow K8s YAML formatting conventions
example:
There may be a styling guide somewhere but I can't find it - looking at K8s documentation
The text was updated successfully, but these errors were encountered: