Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent mounting of code if the function uses an image #268

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ custom:
```

## Change Log
* v1.3.1: prevent the mounting of code if the Lambda uses an ECR Image
* v1.3.0: add support for built-in Esbuild in Serverless Framework v4 #267
* v1.2.1: Fix custom-resource bucket compatibility with serverless >3.39.0, continue improving support for `AWS_ENDPOINT_URL`
* v1.2.0: Add docker-compose config and fix autostart when plugin is not active
* v1.1.3: Fix replacing host from environment variable `AWS_ENDPOINT_URL`
Expand Down
2 changes: 1 addition & 1 deletion example/service/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ provider:
name: aws
profile: ${opt:profile, self:custom.profile}
stage: ${opt:stage, self:custom.defaultStage}
runtime: nodejs16.x
runtime: nodejs20.x
lambdaHashingVersion: '20201221'

custom:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "serverless-localstack",
"version": "1.2.1",
"version": "1.3.1",
"description": "Connect Serverless to LocalStack!",
"main": "src/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const defaultConfig = {
service: 'aws-nodejs',
provider: {
name: 'aws',
runtime: 'nodejs12.x',
runtime: 'nodejs20.x',
lambdaHashingVersion: '20201221',
environment: {
LAMBDA_STAGE:
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ class LocalstackPlugin {

// Patch plugin methods
function compileFunction(functionName) {
if (!this.shouldMountCode()) {
const functionObject = this.serverless.service.getFunction(functionName);
if (functionObject.image || !this.shouldMountCode()) {
return compileFunction._functionOriginal.apply(null, arguments);
}
const functionObject = this.serverless.service.getFunction(functionName);
functionObject.package = functionObject.package || {};
functionObject.package.artifact = __filename;
return compileFunction._functionOriginal
Expand Down
Loading