Skip to content

Commit

Permalink
Fix build failing with Windows target (#7921)
Browse files Browse the repository at this point in the history
  • Loading branch information
eladlachmi authored Jun 26, 2024
1 parent 4dc3440 commit 9fffdab
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 5 deletions.
6 changes: 1 addition & 5 deletions cmd/lakefs/cmd/flare.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import (
"fmt"
"os"
"path/filepath"
"runtime"
"strings"
"syscall"
"time"

"github.com/jedib0t/go-pretty/v6/text"
Expand Down Expand Up @@ -39,9 +37,7 @@ var flareCmd = &cobra.Command{
Args: cobra.ExactArgs(0),
PreRun: warnOutputFlags,
Run: func(cmd *cobra.Command, args []string) {
if runtime.GOOS != "windows" {
syscall.Umask(flare.FlareUmask)
}
flare.SetBaselinePermissions(flare.FlareUmask)
now := strings.ReplaceAll(time.Now().String(), " ", "")
cfg := loadConfig()
envVarBlacklist := addAppEnvVarPrefix(config.GetSecureStringKeyPaths(cfg))
Expand Down
7 changes: 7 additions & 0 deletions pkg/flare/permissions_darwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package flare

import "syscall"

func SetBaselinePermissions(mask int) {
syscall.Umask(mask)
}
7 changes: 7 additions & 0 deletions pkg/flare/permissions_freebsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package flare

import "syscall"

func SetBaselinePermissions(mask int) {
syscall.Umask(mask)
}
7 changes: 7 additions & 0 deletions pkg/flare/permissions_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package flare

import "syscall"

func SetBaselinePermissions(mask int) {
syscall.Umask(mask)
}
7 changes: 7 additions & 0 deletions pkg/flare/permissions_openbsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package flare

import "syscall"

func SetBaselinePermissions(mask int) {
syscall.Umask(mask)
}
5 changes: 5 additions & 0 deletions pkg/flare/permissions_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package flare

func SetBaselinePermissions(_ int) {
return
}

0 comments on commit 9fffdab

Please sign in to comment.