Skip to content

Commit 90a9483

Browse files
authored
prevent mounting of code if the function uses an image (#268)
1 parent 62b9d5e commit 90a9483

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ custom:
208208
```
209209
210210
## Change Log
211+
* v1.3.1: prevent the mounting of code if the Lambda uses an ECR Image
212+
* v1.3.0: add support for built-in Esbuild in Serverless Framework v4 #267
211213
* v1.2.1: Fix custom-resource bucket compatibility with serverless >3.39.0, continue improving support for `AWS_ENDPOINT_URL`
212214
* v1.2.0: Add docker-compose config and fix autostart when plugin is not active
213215
* v1.1.3: Fix replacing host from environment variable `AWS_ENDPOINT_URL`

Diff for: example/service/serverless.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ provider:
44
name: aws
55
profile: ${opt:profile, self:custom.profile}
66
stage: ${opt:stage, self:custom.defaultStage}
7-
runtime: nodejs16.x
7+
runtime: nodejs20.x
88
lambdaHashingVersion: '20201221'
99

1010
custom:

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-localstack",
3-
"version": "1.2.1",
3+
"version": "1.3.1",
44
"description": "Connect Serverless to LocalStack!",
55
"main": "src/index.js",
66
"scripts": {

Diff for: spec/helpers/services.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const defaultConfig = {
1616
service: 'aws-nodejs',
1717
provider: {
1818
name: 'aws',
19-
runtime: 'nodejs12.x',
19+
runtime: 'nodejs20.x',
2020
lambdaHashingVersion: '20201221',
2121
environment: {
2222
LAMBDA_STAGE:

Diff for: src/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@ class LocalstackPlugin {
198198

199199
// Patch plugin methods
200200
function compileFunction(functionName) {
201-
if (!this.shouldMountCode()) {
201+
const functionObject = this.serverless.service.getFunction(functionName);
202+
if (functionObject.image || !this.shouldMountCode()) {
202203
return compileFunction._functionOriginal.apply(null, arguments);
203204
}
204-
const functionObject = this.serverless.service.getFunction(functionName);
205205
functionObject.package = functionObject.package || {};
206206
functionObject.package.artifact = __filename;
207207
return compileFunction._functionOriginal

0 commit comments

Comments
 (0)