Skip to content

Commit 4a0863f

Browse files
authored
Fix symlink path separators (knative#2535) (#967)
When running on Windows the path separators in symlink target is backslash. This must be fixed up when uploading source code into docker daemon or into cluster volume. Signed-off-by: Matej Vašek <[email protected]>
1 parent 71fa2f6 commit 4a0863f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/builders/s2i/builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ func (b *Builder) Build(ctx context.Context, f fn.Function, platforms []fn.Platf
295295
}
296296
}
297297

298-
hdr, err := tar.FileInfoHeader(fi, lnk)
298+
hdr, err := tar.FileInfoHeader(fi, filepath.ToSlash(lnk))
299299
if err != nil {
300300
return fmt.Errorf("cannot create tar header: %w", err)
301301
}

pkg/pipelines/tekton/pipelines_provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ func sourcesAsTarStream(f fn.Function) *io.PipeReader {
336336
}
337337
}
338338

339-
hdr, err := tar.FileInfoHeader(fi, lnk)
339+
hdr, err := tar.FileInfoHeader(fi, filepath.ToSlash(lnk))
340340
if err != nil {
341341
return fmt.Errorf("cannot create a tar header: %w", err)
342342
}

0 commit comments

Comments
 (0)