Skip to content

Commit

Permalink
Perform a shallow clone in the git provider for faster startup
Browse files Browse the repository at this point in the history
Running katafygio for a couple of months on rather active cluster
results in a huge git repo.

On startup, katafygio clone the git repository, which in our case was
very slow, exceeding the configured deadlines.

This PR propose to perform a shallow clone with a depth of 1: katafygio
doesn't need to full history to work, and the startup is much snappier.
  • Loading branch information
jawher committed Jan 15, 2019
1 parent 7b0af9e commit 6bfebe6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/store/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (s *Store) CloneOrInit() (err error) {
if s.URL == "" {
err = s.Git("init", s.LocalDir)
} else {
err = s.Git("clone", s.URL, s.LocalDir)
err = s.Git("clone", "--depth=1", s.URL, s.LocalDir)
}

if err != nil {
Expand Down

0 comments on commit 6bfebe6

Please sign in to comment.