Skip to content

Commit 4bab734

Browse files
authored
Merge pull request #505 from netlify/al2-without-manifest
fix: upload non-zisi-compiled files as `provided.al2`
2 parents 2d4ead2 + d81ff6c commit 4bab734

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

go/porcelain/deploy.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ func bundle(ctx context.Context, functionDir string, observer DeployObserver) (*
746746
}
747747
functions.Add(file.Name, file)
748748
case goFile(filePath, i, observer):
749-
file, err := newFunctionFile(filePath, i, goRuntime, nil, observer)
749+
file, err := newFunctionFile(filePath, i, amazonLinux2, nil, observer)
750750
if err != nil {
751751
return nil, nil, nil, err
752752
}
@@ -975,14 +975,7 @@ func ignoreFile(rel string, ignoreInstallDirs bool) bool {
975975
}
976976

977977
func createHeader(archive *zip.Writer, i os.FileInfo, runtime string) (io.Writer, error) {
978-
if runtime == goRuntime {
979-
return archive.CreateHeader(&zip.FileHeader{
980-
CreatorVersion: 3 << 8, // indicates Unix
981-
ExternalAttrs: 0777 << 16, // -rwxrwxrwx file permissions
982-
Name: i.Name(),
983-
Method: zip.Deflate,
984-
})
985-
} else if runtime == amazonLinux2 {
978+
if runtime == goRuntime || runtime == amazonLinux2 {
986979
return archive.CreateHeader(&zip.FileHeader{
987980
CreatorVersion: 3 << 8, // indicates Unix
988981
ExternalAttrs: 0777 << 16, // -rwxrwxrwx file permissions

go/porcelain/deploy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ func TestBundle(t *testing.T) {
624624
assert.Equal(t, "js", jsFunction.Runtime)
625625
assert.Equal(t, "py", pyFunction.Runtime)
626626
assert.Equal(t, "rs", rsFunction.Runtime)
627-
assert.Equal(t, "go", goFunction.Runtime)
627+
assert.Equal(t, "provided.al2", goFunction.Runtime)
628628
}
629629

630630
func TestBundleWithManifest(t *testing.T) {

0 commit comments

Comments
 (0)