[Bug] All versions deleted regardless of -n flag
Opened this issue · 4 comments
Steps to reproduce:
yarn add --dev serverless-prune-plugin
// Add plugin to serverless file
sls prune -n 10 --stage {stage} --dryRun
All versions for all functions in file will be marked as selected for deletion. Running without --dryRun
will delete all versions.
Environment Info:
Serverless: 2.4
yarn: 1.22.10
serverless-prune-plugin: ^2.0.1
Ubuntu: 20.04.2 LTS
Hi @richardcook-brandlive — I am able to reproduce this issue. It worked as expected using the Framework + Plugin versions provided in a test project that I attempted. Can you provide additional clarity?
Or perhaps if others also encounter this, we'll see additional comments on this issue.
I'm having the same issue. I added the number to serverless.yml file as 3, but all the versions were deleted.
I can also replicate this using "serverless-prune-plugin": "^2.0.1"
sls -v
Framework Core: 2.57.0 (local)
Plugin: 5.4.4
SDK: 4.3.0
Components: 3.16.0
When running
sls prune -n 2 --region us-east-1 --stage staging
Plugins
plugins:
- ./serverless-plugins/validation-rules # plugin-select incompatible with 2.x
- serverless-webpack
- serverless-plugin-select # allow function deployment to specific regions
- serverless-lambda-edge-pre-existing-cloudfront # deploy functions to edge
- serverless-dynamodb-local
- serverless-offline
- serverless-add-api-key # use on multiple apis
- serverless-create-global-dynamodb-table
- serverless-stage-manager # prevent typos in stage names
- serverless-deployment-bucket # create deployment bucket if does not exist
- serverless-prune-plugin
This is happening in serverless v3 as well. It prunes all layers no matter the number you indicate as to keep.