Skip to content

Commit

Permalink
Fix builder for dockerfile template
Browse files Browse the repository at this point in the history
Fix nil pointer dereference when getting the build options packages.

Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
welteki committed Aug 7, 2024
1 parent 35dc699 commit 7f1d56c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions builder/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,17 @@ func BuildImage(image string, handler string, functionName string, language stri
// this was never enforced.
langTemplate.Language = language

var tempPath string
if isDockerfileTemplate(langTemplate.Language) {
langTemplate = nil
}

tempPath, err := CreateBuildContext(functionName, handler, langTemplate, copyExtraPaths)
if err != nil {
return err
tempPath, err = CreateBuildContext(functionName, handler, nil, copyExtraPaths)
if err != nil {
return err
}
} else {
tempPath, err = CreateBuildContext(functionName, handler, langTemplate, copyExtraPaths)
if err != nil {
return err
}
}

if shrinkwrap {
Expand Down

0 comments on commit 7f1d56c

Please sign in to comment.