mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 18:10:59 +00:00
fix loader loader when run from gopath
This commit is contained in:
@@ -43,7 +43,7 @@ func NewLoader(target, r string, fSys fs.FileSystem) (Loader, error) {
|
||||
return nil, fmt.Errorf("Not valid path: root='%s', loc='%s'\n", r, target)
|
||||
}
|
||||
|
||||
if isRepoUrl(target) {
|
||||
if !isLocalTarget(target, fSys) && isRepoUrl(target) {
|
||||
return newGithubLoader(target, fSys)
|
||||
}
|
||||
|
||||
@@ -73,3 +73,8 @@ func isValidLoaderPath(target, root string) bool {
|
||||
func isRootLoaderPath(root string) bool {
|
||||
return root == ""
|
||||
}
|
||||
|
||||
// isLocalTarget checks if a file exists in the filesystem
|
||||
func isLocalTarget(s string, fs fs.FileSystem) bool {
|
||||
return fs.Exists(s)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user