Skip to content

Commit

Permalink
fix: s2i build on Windows (#1641)
Browse files Browse the repository at this point in the history
Make all files executable on Windows s2i build.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
  • Loading branch information
matejvasek committed Mar 21, 2023
1 parent 7c724bc commit 8eeff81
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/builders/s2i/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"os"
"path/filepath"
"regexp"
"runtime"
"strings"

"github.com/docker/docker/api/types"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8eeff81

Please sign in to comment.