Fix symlink path separators (#2535)

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 <matejvasek@gmail.com>
This commit is contained in:
Matej Vašek 2024-10-11 12:39:08 +02:00 committed by GitHub
parent 59aa11c4dd
commit e2621f6637
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -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)
}

View File

@ -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)
}