-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Applicationset git generator with empty yaml files does #12895
Comments
See https://cloud-native.slack.com/archives/C01TSERG0KZ/p1678890329839499 for a bit of discussion as well. |
I ran into this issue today. My desire was to use the existence of an Personally, I would consider the current behavior of ignoring empty yaml files a bug. But at this point, changing the behavior may cause problems for people who have implemented a solution which expects an empty file to do nothing. |
I just ran into the same issue and asked about it on Slack. In my case, I rely on However, looking at the Git generator source code, I don't understand why it shouldn't work. I'm not a Go wizard, but ChatGPT seems to agree:
Any thoughts ? |
Describe the bug
So I'm having a potential issue with the Git Generator using file matching. We're having a file match on certain yaml files to be available. But when a certain yaml file is completely empty (containing no yaml only a newline for example) it isn't detected as a matched file. I can see that the following code (https://github.com/argoproj/argo-cd/blob/master/applicationset/generators/git.go#L138-L148) does a "yaml to array" try. This succeeds on empty files but will result in an empty array. I consider this a bug ... but I'm not sure if others feel the same about it. Or am I missing something?
To Reproduce
Our setup was as follows:
/directory/values/production.yaml (empty file)
/directory/Chart.yaml (helm chart stuff)
/directory/values.yaml (containing generic values stuff used combined with the production.yaml)
Expected behavior
A created application within the applicationsets.
Version
v2.5.8 (OpenShift GitOps)
The text was updated successfully, but these errors were encountered: