`gimlet seal` doesn't keep the field order
When I run gimlet seal on a yaml file, it seals the fields on the given path.
But since it marshals and un-marshals the yaml into a map, it doesn't preserve field order.
The changeset therefor is too large, fields are shuffled.
The task is to keep the field order when running gimlet seal
Potential solution: https://stackoverflow.com/a/42109240/8244089
@laszlocph what about this alternative solution https://gist.github.com/tullo/f4f9e59ca123d976cf9c5f4fdfed7328 ? No yaml wrestling needed in this case and keeps the order in place.
@laszlocph what about this alternative solution https://gist.github.com/tullo/f4f9e59ca123d976cf9c5f4fdfed7328 ? No yaml wrestling needed in this case and keeps the order in place.
Basically that would be string manipulation / matching.
- Spec wise right now people can provide a JSONPath to select the node that needs encrypting, that wouldn't be satisfied easily with this.
- In general this approach feels more fragile - for later enhancements for example would be more difficult
Comparing these drawbacks with the potential simplicity of using a yaml map type.. I would try the yaml.MapSlice first. Now I think of this, Kubernetes codebase does something similar. They have their own mapSlice too(?)
https://github.com/gimlet-io/gimlet/pull/469