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

@@ -18,7 +18,6 @@ package commands
import (
"io"
"path/filepath"
"github.com/spf13/cobra"
@@ -75,17 +74,11 @@ func (o *buildOptions) Validate(args []string) error {
// RunBuild runs build command.
func (o *buildOptions) RunBuild(out io.Writer, fSys fs.FileSystem) error {
l := loader.NewFileLoader(fSys)
absPath, err := filepath.Abs(o.kustomizationPath)
if err != nil {
return err
}
rootLoader, err := l.New(absPath)
rootLoader, err := loader.NewLoader(o.kustomizationPath, fSys)
if err != nil {
return err
}
defer rootLoader.Cleanup()
application, err := app.NewApplication(rootLoader, fSys)
if err != nil {

View File

@@ -19,7 +19,6 @@ package commands
import (
"errors"
"io"
"path/filepath"
"github.com/spf13/cobra"
@@ -68,17 +67,11 @@ func (o *diffOptions) Validate(args []string) error {
// RunDiff gets the differences between Application.MakeCustomizedResMap() and Application.MakeUncustomizedResMap().
func (o *diffOptions) RunDiff(out, errOut io.Writer, fSys fs.FileSystem) error {
l := loader.NewFileLoader(fSys)
absPath, err := filepath.Abs(o.kustomizationPath)
if err != nil {
return err
}
rootLoader, err := l.New(absPath)
rootLoader, err := loader.NewLoader(o.kustomizationPath, fSys)
if err != nil {
return err
}
defer rootLoader.Cleanup()
application, err := app.NewApplication(rootLoader, fSys)
if err != nil {