Skip to content

Commit

Permalink
address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannagreen1 committed Nov 11, 2024
1 parent aa93eab commit 2482d66
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ resource "pagerduty_automation_actions_action" "test" {
process_automation_job_arguments = "-arg 1"
process_automation_node_filter = "tags: production"
}
only_invocable_on_unresolved_incidents: true
only_invocable_on_unresolved_incidents = true
}
data "pagerduty_automation_actions_action" "foo" {
Expand Down
5 changes: 4 additions & 1 deletion pagerduty/resource_pagerduty_automation_actions_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ func buildAutomationActionsActionStruct(d *schema.ResourceData) (*pagerduty.Auto
automationActionsAction.OnlyInvocableOnUnresolvedIncidents = &val
}

attr, _ := d.Get("only_invocable_on_unresolved_incidents").(bool)
automationActionsAction.OnlyInvocableOnUnresolvedIncidents = &attr

return &automationActionsAction, nil
}

Expand Down Expand Up @@ -310,7 +313,7 @@ func resourcePagerDutyAutomationActionsActionRead(d *schema.ResourceData, meta i
}

if automationActionsAction.OnlyInvocableOnUnresolvedIncidents != nil {
d.Set("only_invocable_on_unresolved_incidents", &automationActionsAction.OnlyInvocableOnUnresolvedIncidents)
d.Set("only_invocable_on_unresolved_incidents", *automationActionsAction.OnlyInvocableOnUnresolvedIncidents)
}
}
return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func TestAccPagerDutyAutomationActionsActionTypeProcessAutomation_Basic(t *testi
resource.TestCheckResourceAttrSet("pagerduty_automation_actions_action.foo", "modify_time"),
resource.TestCheckResourceAttrSet("pagerduty_automation_actions_action.foo", "runner_id"),
resource.TestCheckResourceAttr("pagerduty_automation_actions_action.foo", "runner_type", "runbook"),
resource.TestCheckResourceAttr("pagerduty_automation_actions_action.foo", "only_invocable_on_unresolved_incidents", "true"),
resource.TestCheckResourceAttr("pagerduty_automation_actions_action.foo", "only_invocable_on_unresolved_incidents", "false"),
),
},
},
Expand Down Expand Up @@ -218,7 +218,7 @@ resource "pagerduty_automation_actions_action" "foo" {
process_automation_job_id = "pa_job_id_123"
process_automation_job_arguments = "-arg 1"
process_automation_node_filter = "tags: production"
},
}
only_invocable_on_unresolved_incidents = "true"
}
`, actionName, actionName)
Expand Down

0 comments on commit 2482d66

Please sign in to comment.