Delete hashicorp cloner.

This commit is contained in:
jregan
2018-11-22 16:54:23 -08:00
parent 7c1277f24c
commit a40c2502de
238 changed files with 4 additions and 62987 deletions

View File

@@ -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)
}

View File

@@ -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()
}

View File

@@ -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)
}