Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Commit 9976f4b

Browse files
committed
remove tags only if current tags are present
1 parent a804963 commit 9976f4b

File tree

1 file changed

+7
-6
lines changed
  • packages/serverless-components/aws-lambda

1 file changed

+7
-6
lines changed

packages/serverless-components/aws-lambda/utils.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,13 @@ const updateLambdaConfig = async ({
167167

168168
// If tags are not the same then update them
169169
if (!_.isEqual(currentTags, tags)) {
170-
await lambda
171-
.untagResource({
172-
Resource: res.FunctionArn,
173-
TagKeys: Object.keys(currentTags)
174-
})
175-
.promise();
170+
if (currentTags && Object.keys(currentTags).length > 0)
171+
await lambda
172+
.untagResource({
173+
Resource: res.FunctionArn,
174+
TagKeys: Object.keys(currentTags)
175+
})
176+
.promise();
176177

177178
if (Object.keys(tags).length > 0)
178179
await lambda

0 commit comments

Comments
 (0)