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

resource_pagerduty_service_integration: Fix panic #214

Merged
merged 1 commit into from
Apr 19, 2020

Conversation

heimweh
Copy link
Collaborator

@heimweh heimweh commented Apr 18, 2020

Fixes #204

If the service integration cannot be found we must return early, this is
to prevent running into a panic when trying to dereference further down
when setting the state.

We also mark the "service" attribute with ForceNew since we don't have a
way of migrating service integrations to another service. This means
that service integrations will be destroyed and re-created. This fixes
the current behavior where Terraform would just return an error, forcing
the user to run Terraform again so that the new service integration can
be created. This fixes it all in one go by destroying the previous
service integration from the old service and adding it to the new
service without having to run it two times. Note: This only happens if
the "service" attribute changes.

If the service integration cannot be found we must return early, this is
to prevent running into a panic when trying to dereference further down
when setting the state.

We also mark the "service" attribute with ForceNew since we don't have a
way of migrating service integrations to another service. This means
that service integrations will be destroyed and re-created. This fixes
the current behavior where Terraform would just return an error, forcing
the user to run Terraform again so that the new service integration can
be created. This fixes it all in one go by destroying the previous
service integration from the old service and adding it to the new
service without having to run it two times. Note: This only happens if
the "service" attribute changes. This won't affect already existing
integrations.
@heimweh heimweh requested a review from stmcallister April 18, 2020 11:47
@ghost ghost added the size/XS label Apr 18, 2020
Copy link
Contributor

@stmcallister stmcallister left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for fixing this!

@heimweh heimweh merged commit 8d6f69f into PagerDuty:master Apr 19, 2020
@heimweh heimweh deleted the ah/panic branch April 19, 2020 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pagerduty provider v1.6.1 seems broken
2 participants