Skip to content

Commit

Permalink
test without destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
lourens-octopus committed Dec 8, 2024
1 parent d524c2c commit b9dbf7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion octopusdeploy_framework/resource_git_trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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: %d, name: '%s'", client.GetSpaceID(), data.SpaceId.ValueString(), len(projectTriggers), projectTriggers[0].Name)
resp.Diagnostics.AddError(reason, err.Error())
return
}
Expand Down
1 change: 0 additions & 1 deletion octopusdeploy_framework/resource_git_trigger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit b9dbf7f

Please sign in to comment.