Skip to content
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

Retain or sort YAML ordering of images component when using Git write-back method #502

Open
nabadger opened this issue Dec 12, 2022 · 0 comments · May be fixed by #666
Open

Retain or sort YAML ordering of images component when using Git write-back method #502

nabadger opened this issue Dec 12, 2022 · 0 comments · May be fixed by #666
Labels
enhancement New feature or request

Comments

@nabadger
Copy link

nabadger commented Dec 12, 2022

Is your feature request related to a problem? Please describe.

When the Image Updater updates kustomiztion.yaml file it does not sort the image component for new entries (nor retain existing formatting).

- name: ...
  digest: ...

vs (say via the use of kustomize)

  - digest: ...
    name: ...

Describe the solution you'd like
I would like the ordering to be sorted, or to retain the existing formatting.

Additional context
This is useful for us because we perform git diff comparisons (golden-tests) as part of our CI on our rendered manifests. Because argocd-image-updater changes the ordering, we frequently hit failed pipelines.

@nabadger nabadger added the enhancement New feature or request label Dec 12, 2022
@nabadger nabadger changed the title Retain or sort YAML ordering of images component Retain or sort YAML ordering of images component when using Git write-back method Dec 12, 2022
jtdoepke added a commit to jtdoepke/argocd-image-updater that referenced this issue Jan 9, 2024
This commit causes argocd-image-updater to preserve the order of fields
in the kustomization.yaml file when updating the image(s). Doing so will
minimize git diffs in the case that other tools also edit the
kustomization.yaml file.

Fixes argoproj-labs#502
jtdoepke added a commit to jtdoepke/argocd-image-updater that referenced this issue Jan 9, 2024
This commit causes argocd-image-updater to preserve the order of fields
in the kustomization.yaml file when updating the image(s). Doing so will
minimize git diffs in the case that other tools also edit the
kustomization.yaml file.

Fixes argoproj-labs#502
jtdoepke added a commit to jtdoepke/argocd-image-updater that referenced this issue Jan 25, 2024
This commit causes argocd-image-updater to preserve the order of fields
in the kustomization.yaml file when updating the image(s). Doing so will
minimize git diffs in the case that other tools also edit the
kustomization.yaml file.

Fixes argoproj-labs#502
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant