diff --git a/pkg/chart/loader/local.go b/pkg/action/local.go similarity index 92% rename from pkg/chart/loader/local.go rename to pkg/action/local.go index 38f080827..21d6c6ca4 100644 --- a/pkg/chart/loader/local.go +++ b/pkg/action/local.go @@ -11,7 +11,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package loader +package action import ( "errors" @@ -20,8 +20,8 @@ import ( "strings" ) -// ExpandFilePath expands a local file, dir or glob path to a list of files -func ExpandFilePath(path string) ([]string, error) { +// expandFilePath expands a local file, dir or glob path to a list of files +func expandFilePath(path string) ([]string, error) { if strings.Contains(path, "*") { // if this is a glob, we expand it and return a list of files return expandGlob(path) diff --git a/pkg/chart/loader/local_test.go b/pkg/action/local_test.go similarity index 60% rename from pkg/chart/loader/local_test.go rename to pkg/action/local_test.go index 456d0dddf..29ac7c107 100644 --- a/pkg/chart/loader/local_test.go +++ b/pkg/action/local_test.go @@ -11,7 +11,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package loader +package action import ( "testing" @@ -22,17 +22,15 @@ import ( func TestExpandLocalPath(t *testing.T) { req := require.New(t) - glob, err := ExpandFilePath("testdata/frobnitz/*.yaml") + glob, err := expandFilePath("testdata/output/*.txt") req.NoError(err) - req.Contains(glob, "testdata/frobnitz/Chart.yaml") - req.Contains(glob, "testdata/frobnitz/values.yaml") + req.Contains(glob, "testdata/output/list-compressed-deps.txt") + req.Contains(glob, "testdata/output/list-missing-deps.txt") - dir, err := ExpandFilePath("testdata/albatross/") + dir, err := expandFilePath("testdata/files/") req.NoError(err) - req.Contains(dir, "testdata/albatross/Chart.yaml") - req.Contains(dir, "testdata/albatross/values.yaml") + req.Contains(dir, "testdata/files/external.txt") - file, err := ExpandFilePath("testdata/albatross/Chart.yaml") - req.NoError(err) - req.Contains(file, "testdata/albatross/Chart.yaml") + _, err = expandFilePath("testdata/non_existing") + req.Error(err) }