You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the 1.0 installation of flux I have noticed that when the 1.0 flux controller updates the image version of a formatted manifest, the manifest in our case was formatted with prettier, flux doesn't change just the image tag it will enforce its own formatting probably based how the go-yaml package unmarshalls yaml.
What I would like is the ability to have a gitops flux repo where I can enforce formatting using a tool like prettier. I see two options where I can get this.
Add hooks in flux that allow us to run arbitrary commands on the modified yaml when an image patch is committed. This is a bit of a complex problem because the flux docker image wouldn't necessarily have the ability to run prettier so people that want to leverage this would have to run a baked version of the flux were they also install their formatter.
Get a better understanding on how flux is formatting the yaml files today and a means of replicating that with a formatter that I can invoke via bash against a yaml file. This way I could just make my repo formatter consistent with the formatting that flux will use when it generates yaml.
When using the 1.0 installation of flux I have noticed that when the 1.0 flux controller updates the image version of a formatted manifest, the manifest in our case was formatted with prettier, flux doesn't change just the image tag it will enforce its own formatting probably based how the
go-yaml
package unmarshalls yaml.What I would like is the ability to have a gitops flux repo where I can enforce formatting using a tool like prettier. I see two options where I can get this.
Add hooks in flux that allow us to run arbitrary commands on the modified yaml when an image patch is committed. This is a bit of a complex problem because the flux docker image wouldn't necessarily have the ability to run prettier so people that want to leverage this would have to run a baked version of the flux were they also install their formatter.
Get a better understanding on how flux is formatting the yaml files today and a means of replicating that with a formatter that I can invoke via bash against a yaml file. This way I could just make my repo formatter consistent with the formatting that flux will use when it generates yaml.
Concrete Example
the above was styled by prettier by running
prettier ./file-name -w
.below was what flux will generate after bumping the image version.
Notice how the section starting with
- env:
is unindented.More Color
I cannot configure prettier to match the current formatting that flux uses according to these issues prettier/prettier#4723 prettier/prettier#9355
The text was updated successfully, but these errors were encountered: