From 8d6f1cc2c49994db88620b4ff93cfbb2e519d33a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9a=20Grondier?= Date: Mon, 23 Dec 2024 13:46:57 +0100 Subject: [PATCH] mysql user: wait for db RUNNING before allowing user creation --- pkg/resources/database/resource_user_mysql.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/resources/database/resource_user_mysql.go b/pkg/resources/database/resource_user_mysql.go index 8d578415..88334753 100644 --- a/pkg/resources/database/resource_user_mysql.go +++ b/pkg/resources/database/resource_user_mysql.go @@ -233,7 +233,7 @@ func (data *MysqlUserResourceModel) UpdateResource(ctx context.Context, client * } func (data *MysqlUserResourceModel) WaitForService(ctx context.Context, client *exoscale.Client, diagnostics *diag.Diagnostics) { - _, err := waitForDBAASServiceReadyForUsers(ctx, client.GetDBAASServiceMysql, data.Service.ValueString(), func(t *exoscale.DBAASServiceMysql) bool { return len(t.Users) > 0 }) + _, err := waitForDBAASServiceReadyForUsers(ctx, client.GetDBAASServiceMysql, data.Service.ValueString(), func(t *exoscale.DBAASServiceMysql) bool { return t.State == exoscale.EnumServiceStateRunning }) if err != nil { diagnostics.AddError("Client Error", fmt.Sprintf("Unable to read Database service MySQL %s", err.Error())) }