Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing "Removal" of Schedule Layers #257

Merged
merged 12 commits into from
Jul 25, 2020

Conversation

stmcallister
Copy link
Contributor

@stmcallister stmcallister commented Jul 24, 2020

This allows for the "removal" of schedule layers. Removal is in quotes because the PagerDuty API doesn't allow for deleting of schedule layers--you can only end them. That is what this PR does is set the end value for a schedule layer when you remove the layer from your tf config. Also, added tests for setting the end for a schedule layer, as well as updated the TestAccPagerDutySchedule_Multi test to include updating a schedule by removing a layer.

Finally, removed the ForceNew on schedule layers. Now changes to schedule layers will not force a new creation of a schedule object. Which addresses #43

TF_ACC=1 go test -run "TestAccPagerDutySchedule*" ./pagerduty -v -timeout 120m
=== RUN   TestAccPagerDutySchedule_import
--- PASS: TestAccPagerDutySchedule_import (6.39s)
=== RUN   TestAccPagerDutySchedule_Basic
--- PASS: TestAccPagerDutySchedule_Basic (8.83s)
=== RUN   TestAccPagerDutyScheduleOverflow_Basic
--- PASS: TestAccPagerDutyScheduleOverflow_Basic (7.67s)
=== RUN   TestAccPagerDutySchedule_BasicWeek
--- PASS: TestAccPagerDutySchedule_BasicWeek (7.28s)
=== RUN   TestAccPagerDutySchedule_Multi
--- PASS: TestAccPagerDutySchedule_Multi (12.10s)
PASS
ok  	github.com/terraform-providers/terraform-provider-pagerduty/pagerduty	42.738s

Copy link
Collaborator

@heimweh heimweh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 🙌
This LGTM 🙂👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants