resolvers: do not join paths, it is assumed they are already joined

Signed-off-by: Alfredo Deza <adeza@anchore.com>
This commit is contained in:
Alfredo Deza 2020-07-16 13:12:42 -04:00
parent d82a0872c9
commit a05d58686e

View File

@ -74,14 +74,8 @@ func (s DirectoryResolver) FilesByGlob(patterns ...string) ([]file.Reference, er
func (s DirectoryResolver) MultipleFileContentsByRef(f ...file.Reference) (map[file.Reference]string, error) {
refContents := make(map[file.Reference]string)
for _, fileRef := range f {
resolvedPath := path.Join(s.Path, string(fileRef.Path))
_, err := os.Stat(resolvedPath)
if os.IsNotExist(err) {
continue
} else if err != nil {
log.Errorf("path (%s) is not valid: %v", resolvedPath, err)
}
contents, err := fileContents(file.Path(resolvedPath))
contents, err := fileContents(fileRef.Path)
if err != nil {
return refContents, fmt.Errorf("could not read contents of file: %s", fileRef.Path)
}