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

Support files in 'argocd.argoproj.io/manifest-generate-paths' annotation #9907

Closed
jmwri opened this issue Jul 8, 2022 · 3 comments · Fixed by #9908
Closed

Support files in 'argocd.argoproj.io/manifest-generate-paths' annotation #9907

jmwri opened this issue Jul 8, 2022 · 3 comments · Fixed by #9908
Labels
enhancement New feature or request

Comments

@jmwri
Copy link
Contributor

jmwri commented Jul 8, 2022

Summary

The current implementation of argocd.argoproj.io/manifest-generate-paths only supports a list of directories, which is fine 99% of the time, but it would be nice to be able to specify specific files here as well.

Motivation

I am using the app-of-apps pattern within a monorepo with a directory structure similar to the following:

apps-app.yaml -> defines application with source of deployments dir
deployments/
  app-a/
  app-b/
  app-c/
  app-d/
  app-a-app.yaml -> defines application with source of app-a dir
  app-b-app.yaml
  app-c-app.yaml
  app-d-app.yaml
  kustomization.yaml -> includes all app definitions as resources

With this directory structure I would like to set the following annotation on the apps-app: argocd.argoproj.io/manifest-generate-paths: /deployments/kustomization.yaml. This would enable my apps-app to only refresh when a child app has been added or removed.

Currently, I am unable to use the kustomization in the annotation, and instead have to use the entire deployments directory, causing a lot of unnecessary refreshes.

Proposal

Check if file == item within util/webhook.go func appFilesHaveChanged(app *v1alpha1.Application, changedFiles []string) bool.

As it's only a small change I went ahead and created a quick PR: #9908.

@jmwri
Copy link
Contributor Author

jmwri commented Jul 15, 2022

@crenshaw-dev Is there any chance to get this into the next release?

@crenshaw-dev
Copy link
Member

@jmwri I'll see if there's any opposition to cherry-picking it back. If not, I'll add it to 2.4.7 (within the next 3ish days). https://cloud-native.slack.com/archives/C020XM04CUW/p1657899841866619

@jmwri
Copy link
Contributor Author

jmwri commented Jul 15, 2022

That would be fantastic, thanks!

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.

2 participants