mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 09:02:53 +00:00
Add kustomize build {repoUrl}
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user