Describe the bug
It can happen that a deployment runs, fails, retries and doesn't get to re-deploy the resources (e.g. due to a quota issue, lack of idempotency, etc.). As a result, the resources are not attached to the latest re-try (if even available) and as a result, the removal won't learn about any resources either and not remove any.
To reproduce
Run a pipeline e.g. at the limit of deployments
Suggested fix
To mitigate this issue I'd propose to not only return the latest deployment name from the deployment script, but all of them and try to collect all resources connected to any of them during removal.
Describe the bug
It can happen that a deployment runs, fails, retries and doesn't get to re-deploy the resources (e.g. due to a quota issue, lack of idempotency, etc.). As a result, the resources are not attached to the latest re-try (if even available) and as a result, the removal won't learn about any resources either and not remove any.
To reproduce
Run a pipeline e.g. at the limit of deployments
Suggested fix
To mitigate this issue I'd propose to not only return the latest deployment name from the deployment script, but all of them and try to collect all resources connected to any of them during removal.