@@ -520,6 +520,18 @@ func deleteResourcesInCloudFormation(prov client.ConfigProvider, t *cfn_bootstra
520
520
return err == nil || (ok && code == iam .ErrCodeNoSuchEntityException )
521
521
}, 5 * time .Minute , 5 * time .Second ).Should (BeTrue ())
522
522
}
523
+ for _ , group := range groups {
524
+ repeat := false
525
+ Eventually (func (gomega Gomega ) bool {
526
+ _ , err := iamSvc .DeleteGroup (& iam.DeleteGroupInput {GroupName : aws .String (group .GroupName )})
527
+ if err != nil && ! repeat {
528
+ By (fmt .Sprintf ("failed to delete group '%s'; reason: %+v" , group .GroupName , err ))
529
+ repeat = true
530
+ }
531
+ code , ok := awserrors .Code (err )
532
+ return err == nil || (ok && code == iam .ErrCodeNoSuchEntityException )
533
+ }, 5 * time .Minute , 5 * time .Second ).Should (BeTrue ())
534
+ }
523
535
for _ , policy := range policies {
524
536
policies , err := iamSvc .ListPolicies (& iam.ListPoliciesInput {})
525
537
Expect (err ).NotTo (HaveOccurred ())
@@ -545,18 +557,6 @@ func deleteResourcesInCloudFormation(prov client.ConfigProvider, t *cfn_bootstra
545
557
}
546
558
}
547
559
}
548
- for _ , group := range groups {
549
- repeat := false
550
- Eventually (func (gomega Gomega ) bool {
551
- _ , err := iamSvc .DeleteGroup (& iam.DeleteGroupInput {GroupName : aws .String (group .GroupName )})
552
- if err != nil && ! repeat {
553
- By (fmt .Sprintf ("failed to delete group '%s'; reason: %+v" , group .GroupName , err ))
554
- repeat = true
555
- }
556
- code , ok := awserrors .Code (err )
557
- return err == nil || (ok && code == iam .ErrCodeNoSuchEntityException )
558
- }, 5 * time .Minute , 5 * time .Second ).Should (BeTrue ())
559
- }
560
560
}
561
561
562
562
// TODO: remove once test infra accounts are fixed.
0 commit comments