We're encountering an issue when using leftovers on an account that creates multiple PCF environments. When we run leftovers, we pass in a filter whose value is the environment name. We expect that only volumes that are detached and having a tag matching the environment name are deleted.
The behaviour that we are seeing is that detached volumes are deleted regardless of whether the tags match the filter. This results in the deletion of volumes belonging to other environments, if they are detached (an example would be when the volume for a bosh director is temporarily detached to re-create the vm).
Related to https://github.com/genevieve/leftovers/issues/63. The commit associated with that issue appears to add tags to the volume identifier, but checks against the filter aren't performed.
Steps to reproduce:
Create EBS volume with tag:env-name:testenv1234
Create EBS volume with tag env-name:donotdelete1234
We're encountering an issue when using leftovers on an account that creates multiple PCF environments. When we run leftovers, we pass in a filter whose value is the environment name. We expect that only volumes that are detached and having a tag matching the environment name are deleted.
The behaviour that we are seeing is that detached volumes are deleted regardless of whether the tags match the filter. This results in the deletion of volumes belonging to other environments, if they are detached (an example would be when the volume for a bosh director is temporarily detached to re-create the vm).
Related to https://github.com/genevieve/leftovers/issues/63. The commit associated with that issue appears to add tags to the volume identifier, but checks against the filter aren't performed.
Steps to reproduce:
env-name:testenv1234
env-name:donotdelete1234
leftovers --filter=testenv1234 --dry-run
Expected: Only one resource is returned:
Actual: Both resources (plus any other detached disks) are returned