-
Notifications
You must be signed in to change notification settings - Fork 72
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
Image Automation Controller is reformatting inline blocks in a single line #528
Comments
We use kustomize kyaml to mutate the YAMLs and this is how it behaves. I suggest you move the apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: podinfo
namespace: default
spec:
images:
- name: ghcr.io/stefanprodan/podinfo
newName: ghcr.io/stefanprodan/podinfo # {"$imagepolicy": "flux-system:podinfo:name"}
newTag: 5.0.0 # {"$imagepolicy": "flux-system:podinfo:tag"} |
We use the image automation controller mainly with HelmReleases managed by Helm Controller to override the images and tags values from helm. I don't think I understood how I could apply your solution to it. |
You can create a kustomizeconfig to teach Kustomize how to use |
We also have annotations with code blocks in the same YAML and interestingly the annotations are being left intact. Can you help me understand why code blocks in annotations are treated differently? |
Another solution is to move the |
Yes, I think that will work. Still unsure why inline blocks in annotations are not being messed up while other inline blocks elsewhere are. Isn't that strange? |
It is, I can't find the issue now, but it's here somewhere https://github.com/kubernetes-sigs/kustomize/issues?q=is%3Aissue+is%3Aopen+ as I said, we don't edit the YAMLs with our code, we use Kustomize kyaml in Flux. |
I can provide a HelmRelease with a simple deployment to demonstrate so this issue can be linked to kustomize repo. |
@stefanprodan this is becoming a real problem for us. We have large inline block pieces being reformatted in a single line and messing everything :( we currently reverting the commit side effect manually which isn't sustainable. Do you know if this is already open in kustomize ? |
@stefanprodan any update on this? Thank you in advance |
This issue is still relevant for me also. Would love to hear any update ! |
This should've been fixed in #605 You can try it out using |
Great ! Thanks you |
This should be fixed in Flux 2.2.0, please open a new issue if that's not the case. |
When a manifest has block configuration like below and is updated by image automation controller, blocks are overwritten as a single line of code making it unreadable. Code blocks should not be reformatted.
For example, this is pipe block
After image automation controller commit becomes
This behaviour is unexpected, we would like blocks to stay exactly as they were before.
The text was updated successfully, but these errors were encountered: