From 29bb630baebe7d2d6eec40cb37f475ccd89f0b9e Mon Sep 17 00:00:00 2001 From: Jacob Parry Date: Thu, 1 Jun 2017 15:19:46 -0400 Subject: [PATCH] Ignore "unknown instance" error when rm instance Fixes #4112 Signed-off-by: Jacob Parry --- drivers/amazonec2/amazonec2.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/amazonec2/amazonec2.go b/drivers/amazonec2/amazonec2.go index 9e70fb9d..90e023f6 100644 --- a/drivers/amazonec2/amazonec2.go +++ b/drivers/amazonec2/amazonec2.go @@ -950,6 +950,11 @@ func (d *Driver) terminate() error { _, err := d.getClient().TerminateInstances(&ec2.TerminateInstancesInput{ InstanceIds: []*string{&d.InstanceId}, }) + + if strings.HasPrefix(err.Error(), "unknown instance") { + return nil + } + if err != nil { return fmt.Errorf("unable to terminate instance: %s", err) }