When using Git generator and the the repo contains submodules, the generator does not find files in submodules.
While preparing the repo it uses git submodule sync --recursive and git submodule update --init --recursive which fetches the actual submodule contents, but the file search for the generator uses git ls-files --full-name -z -- **/config.json, which does not search in submodules. The correct command would be git ls-files --full-name -z --recurse-submodules -- **/config.json.
Checklist:
argocd version
.Describe the bug
When using Git generator and the the repo contains submodules, the generator does not find files in submodules.
While preparing the repo it uses
git submodule sync --recursive
andgit submodule update --init --recursive
which fetches the actual submodule contents, but the file search for the generator usesgit ls-files --full-name -z -- **/config.json
, which does not search in submodules. The correct command would begit ls-files --full-name -z --recurse-submodules -- **/config.json
.As I researched how it works, I found the Git client util command here: https://github.com/argoproj/argo-cd/blob/b38ff175245465f1da07b5f32208c4535ed09602/util/git/client.go#L366
The function does not care if the submodule env is set or not, it does not search for files in submodules.
To Reproduce
Example repo structure:
Generator:
See that the generator does not generate any applications.
Expected behavior
ApplicatioSet Controller finds files matching the pattern in Git submodlues.
Screenshots
Version
Logs