Skip to content

Commit

Permalink
pkg/bindings/images.nTar(): slashify hdr.Name values
Browse files Browse the repository at this point in the history
When setting path names in the build context archive, convert path names
to use forward slashes, as is normal for those archives, so that
directory hierarchies archived on Windows hosts extract correctly
everywhere.

Not really sure how to run the remote client in CI on a system that uses
`\` as a path separator, which is where this error crops up, so
[NO TESTS NEEDED]

Signed-off-by: Nalin Dahyabhai <[email protected]>
  • Loading branch information
nalind committed Aug 18, 2021
1 parent a3d8b48 commit aeffdb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/bindings/images/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,9 @@ func nTar(excludes []string, sources ...string) (io.ReadCloser, error) {
return nil // skip root dir
}

name := strings.TrimPrefix(path, s+string(filepath.Separator))
name := filepath.ToSlash(strings.TrimPrefix(path, s+string(filepath.Separator)))

excluded, err := pm.Matches(filepath.ToSlash(name)) // nolint:staticcheck
excluded, err := pm.Matches(name) // nolint:staticcheck
if err != nil {
return errors.Wrapf(err, "error checking if %q is excluded", name)
}
Expand Down

0 comments on commit aeffdb0

Please sign in to comment.