This repository has been archived by the owner on Sep 26, 2021. It is now read-only.
Ensure proper cleanup of dangling resources in case of failure #4317
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In AWS EC2 driver we start creating resources that simply get lost in case
of failure during instance creation.
The worst case scenario is when a SpotInstance price is too low to be fulfilled
before the timeout.
In such case we already created a Key Pair, but we are not going to persist
config.json
due to the failure, and we will never be able to delete such key.Moreover the SpotInstanceRequest will remain in AWS and if it will be fulfilled
later a new instance will be created outside of docker-machine control.
This patch ensures that a proper cleanup is done in case of failure in
amazonec2.Create()
Furthermore
docker-machine rm
is now able to handle properly AWS machinesfailed during creation thanks to this two new conditions:
KeyPairName
InstanceId
Closes #3555