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

prepare clones with --filter=blob:none #551

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cmd/prepare/prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ import (
"github.com/gardener/test-infra/pkg/util"
)

const bloblessClone = "--filter=blob:none"

func runPrepare(log logr.Logger, cfg *prepare.Config, repoBasePath string) error {
fmt.Printf("\n%s\n\n", util.PrettyPrintStruct(cfg))

Expand Down Expand Up @@ -96,7 +98,7 @@ func cloneRepository(log logr.Logger, repo *prepare.Repository, repoBasePath str
repoPath := path.Join(repoBasePath, repo.Name)
log.Info("Clone repo", "repo", repo.URL, "revision", repo.Revision, "path", repoPath)

if err := runCommand(log, cwd, "git", "clone", "-v", repo.URL, repoPath); err != nil {
if err := runCommand(log, cwd, "git", "clone", bloblessClone, "-v", repo.URL, repoPath); err != nil {
// do some checks to diagnose why git clone fails
if addrs, e := net.LookupHost("github.com"); e == nil {
fmt.Printf("LookupHost github.com: %v\n", addrs)
Expand All @@ -112,7 +114,7 @@ func cloneRepository(log logr.Logger, repo *prepare.Repository, repoBasePath str
_ = runCommand(log, cwd, "nslookup", "kubernetes.default.svc.cluster.local")
// for whatever reason, git clone sometimes fails to resolve github.com => workaround by retrying
log.Info("git clone failed => retrying once")
if err := runCommand(log, cwd, "git", "clone", "-v", repo.URL, repoPath); err != nil {
if err := runCommand(log, cwd, "git", "clone", bloblessClone, "-v", repo.URL, repoPath); err != nil {
return err
}
}
Expand Down