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

[Bug] All versions deleted regardless of -n flag #40

Open
richardcook-brandlive opened this issue Feb 3, 2022 · 4 comments
Open

[Bug] All versions deleted regardless of -n flag #40

richardcook-brandlive opened this issue Feb 3, 2022 · 4 comments

Comments

@richardcook-brandlive
Copy link

richardcook-brandlive commented Feb 3, 2022

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
@claygregory
Copy link
Owner

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.

@SquareLi
Copy link

I'm having the same issue. I added the number to serverless.yml file as 3, but all the versions were deleted.

@benswinburne
Copy link

benswinburne commented Nov 24, 2022

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

@fernandohonig
Copy link

This is happening in serverless v3 as well. It prunes all layers no matter the number you indicate as to keep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants