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

Adding patches to kustomize requires that the kustomization file have a .yaml extension #21914

Open
1 of 3 tasks
mattrasband opened this issue Feb 19, 2025 · 5 comments
Open
1 of 3 tasks
Assignees
Labels
bug Something isn't working

Comments

@mattrasband
Copy link

mattrasband commented Feb 19, 2025

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

Kustomize allows a couple different file names for the kustomization file. If the patches option is included in the kustomization section of an appset file the only allowed filename is kustomization.yaml, causing previously working deployments to break.

To Reproduce

  1. Have a kustomization.yml file for a project pointed to by argoproj.io/v1alpha1.Application without a patches key under spec.source.kustomize.
  2. Add a patch, the error you get is something akin to code = Unknown desc = Manifest generation error (cached): failed to load kustomization.yaml
  3. Rename your kustomization.yml from item 1 to kustomization.yaml
  4. Profit

Expected behavior

There should not be any required changes to the file name when introducing supported features.

Screenshots

Version

v2.11.5+c4b283c

Logs

Paste any relevant application logs here.

Here are the relevant files:

@mattrasband mattrasband added the bug Something isn't working label Feb 19, 2025
@mattrasband
Copy link
Author

It's worth noting that there is a workaround to avoid bumping versions when this is fixed: simply rename kustomzation.yml/Kustomization to kustomization.yaml

@crenshaw-dev
Copy link
Member

We should borrow code from Kustomize to make sure that our file extension handling matches theirs. https://github.com/kubernetes-sigs/kustomize/blob/447a60903cd142948443a6bd441b2749ad643815/api/konfig/general.go#L12

@crenshaw-dev
Copy link
Member

This is probably the exact function we need: https://github.com/kubernetes-sigs/kustomize/blob/447a60903cd142948443a6bd441b2749ad643815/api/internal/target/kusttarget.go#L100

@nitishfy
Copy link
Member

I'd like to take this up.

@nitishfy nitishfy self-assigned this Feb 20, 2025
@mattrasband
Copy link
Author

I'd like to take this up.

Sounds good @nitishfy - let me know if you change your mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants