summaryrefslogtreecommitdiff
path: root/pkg/bindings/images
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2021-08-18 09:52:56 -0400
committerNalin Dahyabhai <nalin@redhat.com>2021-08-18 11:03:28 -0400
commitaeffdb05d1782176ac9aee8482bbf1f96228b3ae (patch)
tree4d546ec74df6b063fc58e5ee2456325233bb5fee /pkg/bindings/images
parenta3d8b48fd56a722642f7cbcad52b2fa88f12b656 (diff)
downloadpodman-aeffdb05d1782176ac9aee8482bbf1f96228b3ae.tar.gz
podman-aeffdb05d1782176ac9aee8482bbf1f96228b3ae.tar.bz2
podman-aeffdb05d1782176ac9aee8482bbf1f96228b3ae.zip
pkg/bindings/images.nTar(): slashify hdr.Name values
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 <nalin@redhat.com>
Diffstat (limited to 'pkg/bindings/images')
-rw-r--r--pkg/bindings/images/build.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/bindings/images/build.go b/pkg/bindings/images/build.go
index e1aeae244..39e0fc5df 100644
--- a/pkg/bindings/images/build.go
+++ b/pkg/bindings/images/build.go
@@ -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)
}