Skip to content

Commit

Permalink
lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
natasha41575 committed Feb 1, 2023
1 parent 02fc8d3 commit f43c940
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
3 changes: 0 additions & 3 deletions api/krusty/testdata/helmcharts/test-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@ data:
name: test-image
tag: v1.0.0
imagePullPolicy: Always

test:
labels: label
12 changes: 6 additions & 6 deletions kyaml/copyutil/copyutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ import (
"fmt"
"os"
"path/filepath"
"sigs.k8s.io/kustomize/kyaml/errors"
"strings"

"github.com/sergi/go-diff/diffmatchpatch"
"sigs.k8s.io/kustomize/kyaml/errors"
"sigs.k8s.io/kustomize/kyaml/filesys"
"sigs.k8s.io/kustomize/kyaml/sets"
)

// CopyDir copies a src directory to a dst directory. CopyDir skips copying the .git directory from the src.
func CopyDir(fSys filesys.FileSystem, src string, dst string) error {
return errors.WrapPrefixf(fSys.Walk(src, func(path string, info os.FileInfo, err error) error {
return errors.Wrap(fSys.Walk(src, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
Expand All @@ -38,21 +38,21 @@ func CopyDir(fSys filesys.FileSystem, src string, dst string) error {

// make directories that don't exist
if info.IsDir() {
return fSys.MkdirAll(filepath.Join(dst, copyTo))
return errors.Wrap(fSys.MkdirAll(filepath.Join(dst, copyTo)))
}

// copy file by reading and writing it
b, err := fSys.ReadFile(filepath.Join(src, copyTo))
if err != nil {
return err
return errors.Wrap(err)
}
err = fSys.WriteFile(filepath.Join(dst, copyTo), b)
if err != nil {
return err
return errors.Wrap(err)
}

return nil
}), "error walking through fSys")
}))
}

// Diff returns a list of files that differ between the source and destination.
Expand Down
2 changes: 1 addition & 1 deletion kyaml/copyutil/copyutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"fmt"
"os"
"path/filepath"
"sigs.k8s.io/kustomize/kyaml/filesys"
"testing"

"github.com/stretchr/testify/assert"
. "sigs.k8s.io/kustomize/kyaml/copyutil"
"sigs.k8s.io/kustomize/kyaml/filesys"
)

// TestDiff_identical verifies identical directories return an empty set
Expand Down

0 comments on commit f43c940

Please sign in to comment.