Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/github.com/docker/cli-…
Browse files Browse the repository at this point in the history
…24.0.6incompatible
  • Loading branch information
Sophie Wigmore authored Sep 21, 2023
2 parents f7f6cbd + 0b5e3c6 commit be3803c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/ihop/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ func findFile(image v1.Image, filepath string) (*tar.Header, io.Reader, error) {
return nil, nil, err
}

if strings.TrimPrefix(hdr.Name, "/") == strings.TrimPrefix(filepath, "/") {
// Some images have filepaths with a preceding '.'
// e.g. './etc/...' instead of '/etc/...'
// Strip it off if it exists
headerName := strings.TrimPrefix(hdr.Name, ".")

if strings.TrimPrefix(headerName, "/") == strings.TrimPrefix(filepath, "/") {
found = true
if hdr.Typeflag == tar.TypeSymlink {
header, reader, err = findFile(image, path.Join(path.Dir(filepath), hdr.Linkname))
Expand Down

0 comments on commit be3803c

Please # to comment.