Skip to content

Commit 688e7c8

Browse files
Fix test
1 parent aab5fd0 commit 688e7c8

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

cloud/service_account_binding_test.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ func testCheckServiceAccountBindingExists(name string) resource.TestCheckFunc {
147147
return err
148148
}
149149
length := len(serviceAccountBinding.Status.Conditions)
150-
if serviceAccountBinding.Status.Conditions[length-1].Type != "Ready" {
150+
// the IAM
151+
if serviceAccountBinding.Status.Conditions[0].Type != "IAMAccountReady" || serviceAccountBinding.Status.Conditions[0].Status != "True" ||
152+
serviceAccountBinding.Status.Conditions[length-1].Type != "Ready" || serviceAccountBinding.Status.Conditions[length-1].Status != "True" {
151153
return fmt.Errorf(`ERROR_RESOURCE_SERVICE_ACCOUNT_BINDING_NOT_READY: "%s"`, rs.Primary.ID)
152154
}
153155
return nil
@@ -185,7 +187,14 @@ resource "streamnative_service_account_binding" "test-service-account-binding" {
185187
organization = "%s"
186188
service_account_name = streamnative_service_account.test-service-account.name
187189
cluster_name = streamnative_pulsar_cluster.test-pulsar-cluster.name
190+
enable_iam_account_creation = true
188191
}
189192
190-
`, organization, name, poolName, poolNamespace, organization, name, name, location, releaseChannel, organization, name, true)
193+
data "streamnative_service_account_binding" "test-service-account-binding" {
194+
depends_on = [streamnative_service_account_binding.test-service-account-binding]
195+
organization = streamnative_service_account_binding.test-service-account-binding.organization
196+
name = streamnative_service_account_binding.test-service-account-binding.name
197+
}
198+
199+
`, organization, name, poolName, poolNamespace, organization, name, name, location, releaseChannel, organization, name, true, organization)
191200
}

0 commit comments

Comments
 (0)