Skip to content

Commit

Permalink
Relax Docker Builder requirements on non-Windows platforms (#773)
Browse files Browse the repository at this point in the history
* Relax Docker Builder requirements on non-Windows platforms

* .golangci.yml: exclude G115 gosec's rule
  • Loading branch information
edigaryev committed Aug 26, 2024
1 parent cbf2d0e commit ea7e853
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ linters-settings:
exhaustive:
default-signifies-exhaustive: true

gosec:
excludes:
- G115

linters:
enable:
- asciicheck
Expand Down
5 changes: 4 additions & 1 deletion internal/executor/instance/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ func NewFromProto(
case *api.DockerBuilder:
// Ensures that we're not trying to run e.g. Windows-specific scripts on macOS
instanceOS := strings.ToLower(instance.Platform.String())
if runtime.GOOS != instanceOS {

haveOrNeedWindows := runtime.GOOS == "windows" || instanceOS == "windows"

if runtime.GOOS != instanceOS && haveOrNeedWindows {
return nil, fmt.Errorf("%w: cannot run %s Docker Builder instance on this platform",
ErrFailedToCreateInstance, cases.Title(language.AmericanEnglish).String(instanceOS))
}
Expand Down

0 comments on commit ea7e853

Please sign in to comment.