Skip to content

Commit d9e9f22

Browse files
authored
fix: s2i build on Windows (#1644)
Make all files executable on Windows s2i build. Signed-off-by: Matej Vasek <[email protected]>
1 parent 1dd4eb6 commit d9e9f22

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: s2i/builder.go

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"net/url"
1111
"os"
1212
"path/filepath"
13+
"runtime"
1314
"strings"
1415

1516
"github.com/docker/docker/api/types"
@@ -243,6 +244,11 @@ func (b *Builder) Build(ctx context.Context, f fn.Function) (err error) {
243244
}
244245
hdr.Name = filepath.ToSlash(p)
245246

247+
if runtime.GOOS == "windows" {
248+
// Windows does not have execute permission, we assume that all files are executable.
249+
hdr.Mode |= 0111
250+
}
251+
246252
err = tw.WriteHeader(hdr)
247253
if err != nil {
248254
return fmt.Errorf("cannot write header to thar stream: %w", err)

0 commit comments

Comments
 (0)