From 8eeff81580b7f5440861e6b025c8ae28947679f0 Mon Sep 17 00:00:00 2001 From: Matej Vasek Date: Tue, 21 Mar 2023 22:27:52 +0100 Subject: [PATCH] fix: s2i build on Windows (#1641) Make all files executable on Windows s2i build. Signed-off-by: Matej Vasek --- pkg/builders/s2i/builder.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/builders/s2i/builder.go b/pkg/builders/s2i/builder.go index fdad35a31..5f983b6b6 100644 --- a/pkg/builders/s2i/builder.go +++ b/pkg/builders/s2i/builder.go @@ -11,6 +11,7 @@ import ( "os" "path/filepath" "regexp" + "runtime" "strings" "github.com/docker/docker/api/types" @@ -253,6 +254,11 @@ func (b *Builder) Build(ctx context.Context, f fn.Function) (err error) { } hdr.Name = p + if runtime.GOOS == "windows" { + // Windows does not have execute permission, we assume that all files are executable. + hdr.Mode |= 0111 + } + err = tw.WriteHeader(hdr) if err != nil { return fmt.Errorf("cannot write header to thar stream: %w", err)