Skip to content

Commit fdc3c34

Browse files
committed
Wait after terminating EC2 instances
This way, we stop using NICs, before attempting to delete security groups, after cleaning up when diagnosing.
1 parent 9d0adfe commit fdc3c34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gitpod-network-check/cmd/common.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ func cleanup(ctx context.Context, svc *ec2.Client, iamsvc *iam.Client) {
6464
}
6565

6666
if len(InstanceIds) > 0 {
67-
log.Info("Cleaning up: Waiting for 2 minutes so network interfaces are deleted")
68-
time.Sleep(2 * time.Minute)
69-
7067
_, err := svc.TerminateInstances(ctx, &ec2.TerminateInstancesInput{
7168
InstanceIds: InstanceIds,
7269
})
@@ -75,6 +72,9 @@ func cleanup(ctx context.Context, svc *ec2.Client, iamsvc *iam.Client) {
7572
}
7673

7774
log.Info("✅ Instances terminated")
75+
76+
log.Info("Cleaning up: Waiting for 2 minutes so network interfaces are deleted")
77+
time.Sleep(2 * time.Minute)
7878
}
7979

8080
if len(Roles) == 0 {

0 commit comments

Comments
 (0)