Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
Release 2.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Apr 5, 2022
1 parent e237d31 commit 2dc3194
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "serverless-plugin-thundra",
"version": "2.5.9",
"version": "2.6.0",
"description": "Thundra's serverless plugin for automatic wrapping",
"repository": "thundra-io/serverless-plugin-thundra",
"homepage": "https://thundra.io/apm",
Expand Down
21 changes: 14 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ class ServerlessThundraPlugin {
thundraHandlerName,
needHandlerDelegation,
customRuntime,
} = layerInfo[lang];
} = layerInfo[lang]

let skipHandlerDelegation = false
const delegatedHandler = func.environment[delegatedHandlerEnvVarName]
Expand Down Expand Up @@ -414,11 +414,16 @@ class ServerlessThundraPlugin {
if (!skipLayerAddition) {
const userLayerVersion = getUserLayerVersion(func, service, lang)
if (userLayerVersion) {
if (typeof userLayerVersion === 'string'
&& userLayerVersion.toLowerCase() === 'latest') {
if (
typeof userLayerVersion === 'string' &&
userLayerVersion.toLowerCase() === 'latest'
) {
func.layers.push(this.latestLayerArnMap[func.runtime])
} else if (!this.isValidLayerVersion(userLayerVersion)) {
this.warnNoLayerInfoExistsForLangAndVersion(lang, userLayerVersion)
this.warnNoLayerInfoExistsForLangAndVersion(
lang,
userLayerVersion
)
} else {
const layerRegion = service.provider.region
const layerARN = getLayerARN(
Expand All @@ -427,7 +432,7 @@ class ServerlessThundraPlugin {
layerName,
userLayerVersion
)

func.layers.push(layerARN)
}
} else {
Expand All @@ -445,7 +450,7 @@ class ServerlessThundraPlugin {
this.warnHandlerDelegationSkipped(funcName)
}
}

if (customRuntime) {
func.runtime = 'provided'
}
Expand Down Expand Up @@ -597,7 +602,9 @@ class ServerlessThundraPlugin {
}

warnNoLayerInfoExistsForLangAndVersion(lang, version) {
this.log(`No layer information exist for given lang: ${lang} given version: ${version}`)
this.log(
`No layer information exist for given lang: ${lang} given version: ${version}`
)
}

warnHandlerDelegationSkipped(funcName) {
Expand Down
3 changes: 1 addition & 2 deletions src/layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ exports.layerInfo = {
node: {
layerName: 'thundra-lambda-node-layer',
needHandlerDelegation: true,
thundraHandlerName:
'thundra_handler.wrapper',
thundraHandlerName: 'thundra_handler.wrapper',
},
layerAwsAccountNo: 269863060030,
delegatedHandlerEnvVarName: 'THUNDRA_AGENT_LAMBDA_HANDLER',
Expand Down

0 comments on commit 2dc3194

Please sign in to comment.