rancher / fleet

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

Gitcloner recurses submodules #2557

Closed manno closed 3 months ago

manno commented 3 months ago

Refers to https://github.com/rancher/fleet/issues/2492

Pull request content for Rancher QA verification.

Additional QA

Problem

Since switching to go-git, Fleet would no longer clone submodules.

Solution

According to the go-git documentation this is how to enable submodule cloning.

Testing

Engineering Testing

Manual Testing

Tested with fleet-test-data submodule in https://github.com/manno/fleet-experiments

kind: GitRepo
apiVersion: fleet.cattle.io/v1alpha1
metadata:
  name: crd-experiment
spec:
  repo: https://github.com/manno/fleet-experiments
  branch: main
  paths:
    - fleet-test-data/simple-chart
  targets:
    - clusterSelector: {}

Automated Testing

QA Testing Considerations

We would need another repo like rancher/fleet-test-data to include as a submodule.

Regressions Considerations

Too many nested repos are a problem for performance.

manno commented 3 months ago

Do we want tests for this, eg. integration tests? This would help us detect any regression here.

We would need another git repo, so we have one with a submodule. I though about adding fleet-example to fleet-test-data, but that would increase the clone time for all tests 🤷 I guess, I could argue the actual cloning is done by go-git and our unit tests make sure we pass the right parameter to go-git.

weyfonk commented 3 months ago

the actual cloning is done by go-git and our unit tests make sure we pass the right parameter to go-git.

This is good enough for me :+1: