diff --git a/octopusdeploy_framework/resource_git_trigger.go b/octopusdeploy_framework/resource_git_trigger.go index 6352af2f..42a0c927 100644 --- a/octopusdeploy_framework/resource_git_trigger.go +++ b/octopusdeploy_framework/resource_git_trigger.go @@ -162,12 +162,13 @@ func (r *gitTriggerResource) Delete(ctx context.Context, req resource.DeleteRequ client := r.Config.Client + projectTriggers, _ := client.ProjectTriggers.GetAll() project := projects.NewProject(data.ProjectId.ValueString(), data.SpaceId.ValueString(), "") projectTrigger := triggers.NewProjectTrigger(data.Name.ValueString(), data.Description.ValueString(), data.IsDisabled.ValueBool(), project, nil, nil) projectTrigger.ID = data.ID.ValueString() if err := client.ProjectTriggers.Delete(projectTrigger); err != nil { - reason := fmt.Sprintf("unable to delete Git Trigger '%s' with space '%s'", client.GetSpaceID(), data.SpaceId.ValueString()) + reason := fmt.Sprintf("unable to delete Git Trigger '%s' with space '%s', count of triggers: '%s", client.GetSpaceID(), data.SpaceId.ValueString(), len(projectTriggers)) resp.Diagnostics.AddError(reason, err.Error()) return } diff --git a/octopusdeploy_framework/resource_git_trigger_test.go b/octopusdeploy_framework/resource_git_trigger_test.go index 7365ddc0..c8c19b3b 100644 --- a/octopusdeploy_framework/resource_git_trigger_test.go +++ b/octopusdeploy_framework/resource_git_trigger_test.go @@ -72,7 +72,6 @@ func TestAccOctopusDeployGitTrigger(t *testing.T) { //} resource.Test(t, resource.TestCase{ - CheckDestroy: func(s *terraform.State) error { return testGitTriggerCheckDestroy(s) }, PreCheck: func() { TestAccPreCheck(t) }, ProtoV6ProviderFactories: ProtoV6ProviderFactories(), Steps: []resource.TestStep{