Explicitely set service attributes to null #62
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses a change in the behaviour
/services
POST
endpoint in the V2 API of Pagerduty (see documentation). Due to the change we had issues with our Terraform setup.Problem
When creating a service without
acknowledgement_timeout
orauto_resolve_timeout
, the service has acknowledgement timeout feature or auto resolve timeout feature enabled respectively. This was not the case so far. There is no longer a way to create a resource with the features disabled.Expected behaviour:
When creating a
pagerduty.Service
withoutacknowledgement_timeout
orauto_resolve_timeout
by callingclient.CreateService(service)
, the service disables the features and does not setacknowledgement_timeout
andauto_resolve_timeout
. (This used to be the case until a few days ago.)Observed behaviour:
The service enables the features and sets non-zero default values for
acknowledgement_timeout
andauto_resolve_timeout
.Example code for reproducing the issue
Submitted solution
We drop
omitempty
for the attributes in question. This restores the default behaviour ofclient.CreateService(service)
.