Add kustomize build {repoUrl}

This commit is contained in:
Jingfang Liu
2018-08-14 14:56:47 -07:00
parent c9a8bc1121
commit f018370628
9 changed files with 146 additions and 539 deletions

View File

@@ -53,6 +53,9 @@ func (l *fileLoader) Root() string {
// Example: "/home/seans/project" or "/home/seans/project/"
// NOT "/home/seans/project/file.yaml".
func (l *fileLoader) New(newRoot string) (Loader, error) {
if isRepoUrl(newRoot) {
return newGithubLoader(newRoot, l.fSys)
}
if !l.IsAbsPath(l.root, newRoot) {
return nil, fmt.Errorf("Not abs path: l.root='%s', loc='%s'\n", l.root, newRoot)
}
@@ -109,3 +112,8 @@ func (l *fileLoader) Load(location string) ([]byte, error) {
}
return l.fSys.ReadFile(fullLocation)
}
// Cleanup does nothing
func (l *fileLoader) Cleanup() error {
return nil
}