@@ -11,6 +11,8 @@ import (
11
11
"strings"
12
12
"time"
13
13
14
+ "k8s.io/apimachinery/pkg/util/wait"
15
+
14
16
"github.com/aws/aws-sdk-go-v2/aws"
15
17
"github.com/aws/aws-sdk-go-v2/service/iam"
16
18
. "github.com/onsi/ginkgo/v2"
@@ -3499,6 +3501,25 @@ var _ = Describe("Sts cluster creation with external id",
3499
3501
})
3500
3502
Expect (err ).To (BeNil ())
3501
3503
3504
+ By ("Wait for the trust relationship to be updated" )
3505
+ err = wait .PollUntilContextTimeout (
3506
+ context .Background (),
3507
+ 20 * time .Second ,
3508
+ 300 * time .Second ,
3509
+ false ,
3510
+ func (context.Context ) (bool , error ) {
3511
+ result , err := awsClient .IamClient .GetRole (context .TODO (), & iam.GetRoleInput {
3512
+ RoleName : aws .String (roleName ),
3513
+ })
3514
+
3515
+ if strings .Contains (* result .Role .AssumeRolePolicyDocument , ExternalId ) {
3516
+ return true , nil
3517
+ }
3518
+
3519
+ return false , err
3520
+ })
3521
+ Expect (err ).To (BeNil ())
3522
+
3502
3523
By ("Create cluster with external id not same with the role setting one" )
3503
3524
notMatchExternalId := "333B9588-36A5-ECA4-BE8D-7C673B77CDCD"
3504
3525
rosalCommand .AddFlags ("--external-id" , notMatchExternalId )
@@ -3660,7 +3681,7 @@ var _ = Describe("HCP cluster creation supplemental testing",
3660
3681
Eventually (func () (string , error ) {
3661
3682
output , err := clusterService .InstallLog (clusterName )
3662
3683
return output .String (), err
3663
- }, time .Minute * 5 , time .Second * 10 ).Should (And (
3684
+ }, time .Minute * 10 , time .Second * 30 ).Should (And (
3664
3685
ContainSubstring ("hostedclusters %s Version" , clusterName ),
3665
3686
ContainSubstring ("hostedclusters %s Release image is valid" , clusterName )))
3666
3687
@@ -3680,7 +3701,7 @@ var _ = Describe("HCP cluster creation supplemental testing",
3680
3701
Eventually (func () (string , error ) {
3681
3702
output , err := clusterService .UnInstallLog (clusterName )
3682
3703
return output .String (), err
3683
- }, time .Minute * 2 , time .Second * 10 ).
3704
+ }, time .Minute * 20 , time .Second * 30 ).
3684
3705
Should (
3685
3706
ContainSubstring ("hostedclusters %s Reconciliation completed successfully" , clusterName ))
3686
3707
0 commit comments