argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
18.04k stars 5.51k forks source link

ApplicationSet apparently doesn't respect `reposerver.enable.git.submodule: "false"` #19058

Open ftmiro opened 4 months ago

ftmiro commented 4 months ago

Checklist:

Describe the bug

I have an ApplicationSet failing to fetch files from a git generator due the repository used in the generator contain a gitmodule file referencing a repository using git (ssh) protocol, which I don't have an account registered in ArgoCD.

To Reproduce

  1. Disable submodules:
apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-cmd-params-cm
data:
 ....
  reposerver.enable.git.submodule: "false"
 ....

Confirm that the argocd-repo-server pods have the following environment variable in it:

ARGOCD_GIT_MODULES_ENABLED=false

Create an applicationset with a Git generator that refers to a repository containing a submodule pointing to a private repository with no account registered in ArgoCD.

Expected behavior

No errors related to git submodules or attempts to fetch submodules

Version

v2.11.2+25f7504

Logs

failed to get params for second generator in the matrix generator: child generator returned an error on parameter generation: error generating params from git: error retrieving Git files: rpc error: code = Internal desc = unable to checkout git repo https://github.com/org/repo with revision 8293d861c1640ce3e4fdf4f9054ce491d73afed7 pattern values.yaml: failed to initialize repository resources: rpc error: code = Internal desc = Failed to checkout FETCH_HEAD: `git submodule update --init --recursive` failed exit status 1
crenshaw-dev commented 4 months ago

ApplicationSet controller requests to the repo-server override the repo-server's default submodule configuration. This allows people to enable or disable submodules only for AppSet controller requests.

To toggle the appset controller's submodule setting, use the following:

applicationsetcontroller.enable.git.submodule: "false"
pazfelipe commented 4 months ago

@crenshaw-dev , could you be more specific about the location that we should apply this configuration?

applicationsetcontroller.enable.git.submodule: "false"
crenshaw-dev commented 4 months ago

@pazfelipe set that value in argocd-cmd-params-cm and then restart the appset controller.