diff --git a/managed/common.go b/managed/common.go index c21fab4..050cedb 100644 --- a/managed/common.go +++ b/managed/common.go @@ -16,7 +16,7 @@ import ( ) // Use to differentiate errors -var ErrFailedTask = errors.New("") +var ErrFailedTask = errors.New("the task failed") func getProjectId(ctx context.Context, apiClient *openapiclient.APIClient, accountId string) (projectId string, projectIdOK bool, errorMessage string) { accountResp, resp, err := apiClient.AccountApi.ListAccounts(ctx).Execute() diff --git a/managed/resource_allow_list.go b/managed/resource_allow_list.go index 1f35bef..ee5d856 100644 --- a/managed/resource_allow_list.go +++ b/managed/resource_allow_list.go @@ -394,6 +394,9 @@ func removeAllowListFromCluster(ctx context.Context, accountId string, projectId if asState == string(openapiclient.TASKACTIONSTATEENUM_SUCCEEDED) { return nil } + if asState == string(openapiclient.TASKACTIONSTATEENUM_FAILED) { + return ErrFailedTask + } } else { return retry.RetryableError(errors.New("unable to check edit network allow list for cluster : " + message)) } diff --git a/managed/resource_associate_db_audit_export_config_cluster.go b/managed/resource_associate_db_audit_export_config_cluster.go index 035ec4b..e9628e4 100644 --- a/managed/resource_associate_db_audit_export_config_cluster.go +++ b/managed/resource_associate_db_audit_export_config_cluster.go @@ -461,6 +461,9 @@ func (r resourceAssociateDbAuditExportConfigCluster) Delete(ctx context.Context, if asState == string(openapiclient.TASKACTIONSTATEENUM_SUCCEEDED) { return nil } + if asState == string(openapiclient.TASKACTIONSTATEENUM_FAILED) { + return ErrFailedTask + } } else { return retry.RetryableError(errors.New("Unable to check DB audit log config removal: " + message)) } diff --git a/managed/resource_associate_me_cluster.go b/managed/resource_associate_me_cluster.go index dddfdef..5d1bae5 100644 --- a/managed/resource_associate_me_cluster.go +++ b/managed/resource_associate_me_cluster.go @@ -156,6 +156,9 @@ func (r resourceAssociateMetricsExporterCluster) Create(ctx context.Context, req if asState == string(openapiclient.TASKACTIONSTATEENUM_SUCCEEDED) { return nil } + if asState == string(openapiclient.TASKACTIONSTATEENUM_FAILED) { + return ErrFailedTask + } } else { return retry.RetryableError(errors.New("Unable to get check metrics exporter cluster association: " + message)) } @@ -251,6 +254,9 @@ func (r resourceAssociateMetricsExporterCluster) Delete(ctx context.Context, req if asState == string(openapiclient.TASKACTIONSTATEENUM_SUCCEEDED) { return nil } + if asState == string(openapiclient.TASKACTIONSTATEENUM_FAILED) { + return ErrFailedTask + } } else { return retry.RetryableError(errors.New("Unable to check metrics exporter cluster association: " + message)) }