mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-29 17:41:13 +00:00
URL based configuration for git exec timeouts and git submodule cloning
Adds a number of user-accessable options for configuring internal git resource cloning behavior. - Git commands are executed with a configurable timeout by including a parameter like "?timeout=2m30s" in the resource URL. This can improve cloning a large repository, or over a slow network. - Git submodule cloning can be disabled by including a parameter like "?submodules=false" in the resource URL. - Switch the overall query parsing to use url.Parse() and be more extensible.
This commit is contained in:
@@ -14,7 +14,7 @@ type Cloner func(repoSpec *RepoSpec) error
|
||||
// to say, some remote API, to obtain a local clone of
|
||||
// a remote repo.
|
||||
func ClonerUsingGitExec(repoSpec *RepoSpec) error {
|
||||
r, err := newCmdRunner()
|
||||
r, err := newCmdRunner(repoSpec.Timeout)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -36,7 +36,10 @@ func ClonerUsingGitExec(repoSpec *RepoSpec) error {
|
||||
if err = r.run("checkout", "FETCH_HEAD"); err != nil {
|
||||
return err
|
||||
}
|
||||
return r.run("submodule", "update", "--init", "--recursive")
|
||||
if repoSpec.Submodules {
|
||||
return r.run("submodule", "update", "--init", "--recursive")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DoNothingCloner returns a cloner that only sets
|
||||
|
||||
Reference in New Issue
Block a user