Skip to content

Commit

Permalink
Delete hashicorp cloner.
Browse files Browse the repository at this point in the history
  • Loading branch information
monopole committed Nov 23, 2018
1 parent 7c1277f commit a40c250
Show file tree
Hide file tree
Showing 238 changed files with 4 additions and 62,987 deletions.
127 changes: 0 additions & 127 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
Expand Down Expand Up @@ -57,7 +56,3 @@
[[override]]
branch = "master"
name = "github.com/go-openapi/spec"

[[constraint]]
branch = "master"
name = "github.com/hashicorp/go-getter"
2 changes: 1 addition & 1 deletion pkg/loader/fileloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
31 changes: 1 addition & 30 deletions pkg/loader/gitcloner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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()
}
13 changes: 2 additions & 11 deletions pkg/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Loading

0 comments on commit a40c250

Please sign in to comment.