rancher / fleet

Deploy workloads from Git to large fleets of Kubernetes clusters
https://fleet.rancher.io/
Apache License 2.0
1.47k stars 216 forks source link

Submodules aren't cloned recursively anymore since Fleet 0.9.x #2492

Open puffitos opened 4 weeks ago

puffitos commented 4 weeks ago

Is there an existing issue for this?

Current Behavior

After updating to Rancher 2.8.x (and thus getting Fleet 0.9.x), we noticed that some gitrepos which dependend on submodules being recursively cloned as well don't get updated anymore. The Gitjob pods fail with an error in the lines of "failed to download ".

This happens apparently, because the new gitjob gitcloner command that took the place of the tekton containers doesn't clone recursively:

https://github.com/rancher/gitjob/blob/1495df9fee27de43ec8104faece17028a96c7459/cmd/gitcloner/gogit/cloner.go#L71C1-L83C1

This results in our bundles being stuck and having to apply some workaround (like moving our charts/manifests from the local folder to a remote location - which is OK for the time being).

Expected Behavior

The functionality of recursively cloning submodules is still present in the current fleet version.

Steps To Reproduce

  1. Install Fleet 0.8.x (before gitjob became the default cloner for gitrepos)
  2. Deploy a Gitrepo that targets a repository that uses submodules, which include a helm chart (for example, just add a the https://github.com/bitnami/charts as a submodule and instruct fleet to deploy the chart: ./charts/bitnami/nginx/ chart)
  3. See the pod get deployed
  4. Update to fleet 0.9.x
  5. Fleet gitjob for the GitRepo should fail after a force update, because submodule isn't pulled and cannot be found

Environment

- Architecture: amd64
- Fleet Version: 0.9.2
- Cluster: 
  - Provider: seems irrelevant
  - Options: seems irrelevant
  - Kubernetes Version: 1.27.13

Logs

No response

Anything else?

No response