From 60d8334fed9a3da18d940f4bf29e7dea0e613b9e Mon Sep 17 00:00:00 2001 From: Jingfang Liu Date: Tue, 11 Sep 2018 15:23:30 -0700 Subject: [PATCH] remove dependency on internal error --- pkg/commands/kustomizationfile.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pkg/commands/kustomizationfile.go b/pkg/commands/kustomizationfile.go index f84d27ad7..8efa6e011 100644 --- a/pkg/commands/kustomizationfile.go +++ b/pkg/commands/kustomizationfile.go @@ -30,7 +30,6 @@ import ( "github.com/kubernetes-sigs/kustomize/pkg/constants" "github.com/kubernetes-sigs/kustomize/pkg/fs" - interror "github.com/kubernetes-sigs/kustomize/pkg/internal/error" "github.com/kubernetes-sigs/kustomize/pkg/types" ) @@ -89,22 +88,17 @@ func newKustomizationFile(mPath string, fsys fs.FileSystem) (*kustomizationFile, func (mf *kustomizationFile) validate() error { if !mf.fsys.Exists(mf.path) { - errorMsg := fmt.Sprintf("Missing kustomization file '%s'.\n", mf.path) - merr := interror.KustomizationError{KustomizationPath: mf.path, ErrorMsg: errorMsg} - return merr + return fmt.Errorf("Missing kustomization file '%s'.\n", mf.path) } if mf.fsys.IsDir(mf.path) { mf.path = path.Join(mf.path, constants.KustomizationFileName) if !mf.fsys.Exists(mf.path) { - errorMsg := fmt.Sprintf("Missing kustomization file '%s'.\n", mf.path) - merr := interror.KustomizationError{KustomizationPath: mf.path, ErrorMsg: errorMsg} - return merr + return fmt.Errorf("Missing kustomization file '%s'.\n", mf.path) } } else { if !strings.HasSuffix(mf.path, constants.KustomizationFileName) { - errorMsg := fmt.Sprintf("Kustomization file path (%s) should have %s suffix\n", + return fmt.Errorf("Kustomization file path (%s) should have %s suffix\n", mf.path, constants.KustomizationFileSuffix) - return interror.KustomizationError{KustomizationPath: mf.path, ErrorMsg: errorMsg} } } return nil