@@ -3818,8 +3818,6 @@ rm -f go.mod go.sum
38183818go mod init create-msk-topic
38193819go mod tidy
38203820go build .
3821-
3822- ./create-msk-topic --broker "$1" --topic "$2" --role-arn "$3"
38233821` , createMSKTopicBinPath )
38243822
38253823// CreateTopic creates a topic on the MSK cluster.
@@ -3829,8 +3827,21 @@ func (m *mskManager) CreateTopic(ctx context.Context, topic string, c cluster.Cl
38293827
38303828 require .NoError (m .t , c .RunE (ctx , withCTN , "mkdir" , "-p" , createMSKTopicBinPath ))
38313829 require .NoError (m .t , c .PutString (ctx , createMskTopicMain , path .Join (createMSKTopicBinPath , "main.go" ), 0700 , createTopicNode ))
3832- require .NoError (m .t , c .PutString (ctx , setupMskTopicScript , path .Join (createMSKTopicBinPath , "run.sh" ), 0700 , createTopicNode ))
3833- require .NoError (m .t , c .RunE (ctx , withCTN , path .Join (createMSKTopicBinPath , "run.sh" ), m .connectInfo .broker , topic , mskRoleArn ))
3830+ require .NoError (m .t , c .PutString (ctx , setupMskTopicScript ,
3831+ path .Join (createMSKTopicBinPath , "setup.sh" ), 0700 , createTopicNode ))
3832+ require .NoError (m .t , c .RunE (ctx , withCTN ,
3833+ path .Join (createMSKTopicBinPath , "setup.sh" ), m .connectInfo .broker , topic , mskRoleArn ))
3834+ retryOpts := retry.Options {
3835+ InitialBackoff : 1 * time .Minute ,
3836+ MaxBackoff : 5 * time .Minute ,
3837+ }
3838+ require .NoError (m .t , retry .WithMaxAttempts (ctx , retryOpts , 3 ,
3839+ func () error {
3840+ return c .RunE (ctx , withCTN ,
3841+ path .Join (createMSKTopicBinPath , "create-msk-topic" ),
3842+ "--broker" , m .connectInfo .broker , "--topic" , topic , "--role-arn" , mskRoleArn )
3843+
3844+ }))
38343845}
38353846
38363847// TearDown deletes the MSK cluster.
0 commit comments