Skip to content

Commit

Permalink
mysql user: wait for db RUNNING before allowing user creation
Browse files Browse the repository at this point in the history
  • Loading branch information
tgrondier committed Dec 23, 2024
1 parent 3766881 commit 8d6f1cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/resources/database/resource_user_mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
}
Expand Down

0 comments on commit 8d6f1cc

Please # to comment.