Skip to content

Commit

Permalink
Fix symlink path separators (#2535)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
matejvasek authored Oct 11, 2024
1 parent 59aa11c commit e2621f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/builders/s2i/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ func (b *Builder) Build(ctx context.Context, f fn.Function, platforms []fn.Platf
}
}

hdr, err := tar.FileInfoHeader(fi, lnk)
hdr, err := tar.FileInfoHeader(fi, filepath.ToSlash(lnk))
if err != nil {
return fmt.Errorf("cannot create tar header: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/pipelines/tekton/pipelines_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func sourcesAsTarStream(f fn.Function) *io.PipeReader {
}
}

hdr, err := tar.FileInfoHeader(fi, lnk)
hdr, err := tar.FileInfoHeader(fi, filepath.ToSlash(lnk))
if err != nil {
return fmt.Errorf("cannot create a tar header: %w", err)
}
Expand Down

0 comments on commit e2621f6

Please sign in to comment.