mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-30 18:01:21 +00:00
fix test case handling and update a function comment
This commit is contained in:
@@ -30,8 +30,8 @@ func GlobPatterns(fSys filesys.FileSystem, patterns []string) ([]string, error)
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// GlobPatterns accepts a slice of glob strings and returns the set of
|
||||
// matching file paths. If files are not found, will try load from remote.
|
||||
// GlobPatterns accepts a slice of glob strings and returns the set of matching file paths. If files are not found, will try load from remote.
|
||||
// It returns an error if there are no matching files or it can't load from remote.
|
||||
func GlobPatternsWithLoader(fSys filesys.FileSystem, ldr ifc.Loader, patterns []string) ([]string, error) {
|
||||
var result []string
|
||||
for _, pattern := range patterns {
|
||||
|
||||
@@ -91,7 +91,9 @@ func TestGlobPatternsWithLoaderRemoteFile(t *testing.T) {
|
||||
// test load invalid file
|
||||
invalidURL := "http://invalid"
|
||||
resources, err = GlobPatternsWithLoader(fSys, ldr, []string{invalidURL})
|
||||
if err != nil && err.Error() != invalidURL+" has no match: "+invalidURL+" not exist" {
|
||||
if err == nil {
|
||||
t.Fatalf("expected error but did not receive one")
|
||||
} else if err.Error() != invalidURL+" has no match: "+invalidURL+" not exist" {
|
||||
t.Fatalf("unexpected load error: %v", err)
|
||||
}
|
||||
if len(resources) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user