mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 01:50:55 +00:00
Delete hashicorp cloner.
This commit is contained in:
@@ -110,7 +110,7 @@ func (l *fileLoader) Root() string {
|
||||
|
||||
func newLoaderOrDie(fSys fs.FileSystem, path string) *fileLoader {
|
||||
l, err := newFileLoaderAt(
|
||||
path, fSys, []string{}, clonerToUse())
|
||||
path, fSys, []string{}, simpleGitCloner)
|
||||
if err != nil {
|
||||
log.Fatalf("unable to make loader at '%s'; %v", path, err)
|
||||
}
|
||||
|
||||
@@ -18,14 +18,12 @@ package loader
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/pkg/errors"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/go-getter"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// gitCloner is a function that can clone a git repo.
|
||||
@@ -133,30 +131,3 @@ func peelQuery(arg string) (string, string) {
|
||||
}
|
||||
return arg, ""
|
||||
}
|
||||
|
||||
func hashicorpGitCloner(repoUrl string) (
|
||||
checkoutDir string, pathInCoDir string, err error) {
|
||||
dir, err := makeTmpDir()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
checkoutDir = filepath.Join(dir, "repo")
|
||||
url, pathInCoDir := getter.SourceDirSubdir(repoUrl)
|
||||
err = checkout(url, checkoutDir)
|
||||
return
|
||||
}
|
||||
|
||||
// Checkout clones a github repo with specified commit/tag/branch
|
||||
func checkout(url, dir string) error {
|
||||
pwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
client := &getter.Client{
|
||||
Src: url,
|
||||
Dst: dir,
|
||||
Pwd: pwd,
|
||||
Mode: getter.ClientModeDir,
|
||||
}
|
||||
return client.Get()
|
||||
}
|
||||
|
||||
@@ -22,21 +22,12 @@ import (
|
||||
"sigs.k8s.io/kustomize/pkg/ifc"
|
||||
)
|
||||
|
||||
const useHashiCorpCloner = false
|
||||
|
||||
func clonerToUse() gitCloner {
|
||||
if useHashiCorpCloner {
|
||||
return hashicorpGitCloner
|
||||
}
|
||||
return simpleGitCloner
|
||||
}
|
||||
|
||||
// NewLoader returns a Loader.
|
||||
func NewLoader(root string, fSys fs.FileSystem) (ifc.Loader, error) {
|
||||
if isRepoUrl(root) {
|
||||
return newGitLoader(
|
||||
root, fSys, []string{}, clonerToUse())
|
||||
root, fSys, []string{}, simpleGitCloner)
|
||||
}
|
||||
return newFileLoaderAt(
|
||||
root, fSys, []string{}, clonerToUse())
|
||||
root, fSys, []string{}, simpleGitCloner)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user