-
Notifications
You must be signed in to change notification settings - Fork 216
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
spurious diff on pagerduty_schedule #200
Comments
Hi @rblumen-desk! In looking at the diff I'm seeing that you're trying to set timestamps with a decimal value on the time. |
@stmcallister I am not understanding your comment. I don't think that we are on the same page about how I see the problem. On the first run of apply, the provider reads the default value of the rotation start time which is in RFC3339 format, which I believe is compatible with or the same as ISO 8601. You can see the value that we set which in the default value. But it doesn't matter what the default is for the purpose of this ticket because the bug occurs on the second pass. The default could be any value. If the provider could not parse the default value there would be a failure on the first pass. The first time through, the apply completes and creates a schedule. The issue comes on the second run of plan with no code changes. After an apply has completed a second plan with no source code changes should show zero diffs. A diff on a plan against unchanged infrastructure with unchanged code is prima facie a bug. |
Hi @rblumen-desk. I'm still unable to replicate this issue. One of the common issues that I (and other users) run into is not matching the time zone offset with that of your PagerDuty account. Also, in relation to the differing datetime formats, in the schedule resource those |
@stmcallister based on your comments I have done some more experiments on this. I think that there are two different issues here. One is that there is something to do with time zones and possibly DST. If I use a timezone offset of -NN the difference between UTC and Pacific is not stable. To take this off the table I changed the time zone to UTC and a virtual start time of "2020-05-02T17:00:00Z". With that configuration the spurious diff on the rotation_virtual_start field is no longer happening. With a time zone of UTC and setting the value of the date values like this
I am finding this a bit confusing - if the field is being updated internally then the provider should not be comparing it to the value in the terraform file other than on creation. It looks like it is being updated, and is being read back and is being compared. Can you find out if the documentation is correct or if this is working as expected? I am seeing the following behavior which is also confusing. When I start from a zero state, run an apply it builds the resources. Then I run a plan, I get a diff on the start field as described above. If I apply that and run another plan, then I get no diffs. The spurious diff happens once and then does not happen again even with no code changes. |
I believe that I am seeing the same issue. I see the start time value changing any time I modify a schedule. This makes sense from the perspective of the start time I have in my .tf files being different than what is in PagerDuty, but I'm not sure why I'm required to set a start time in tf if PagerDuty is going to determine one for me anyways? |
I confirm that I am seeing the same issue too. The Pagerduty API sets the start time at creation time and TF provider doesn't cater for that. And looking at the Pagerduty API docs the As a temporary workaround @rblumen-desk @sprutton1 I was able to use the Lifecycle Customizations: ignore changes resource block in order to force TF to ignore the changes. resource pagerduty_schedule my_schedule {
...
layer {
start = "2020-01-01T00:00:00Z"
...
}
lifecycle {
ignore_changes = [
layer[0].start
]
}
} |
The docs say this, but it's obviously not true:
|
I've upgraded to 1.9.6 and still have this start diff issue. I have no changes in the configuration file, but PagerDuty updated the The #321 seems to suppress "Equal Diff" when the time is in different format (e.g., timezone) but is the same time. But it cannot fix the above case where the |
@Padorax The So, in Robert's case at the top of this thread, he was trying to set Does that help? |
@stmcallister it does not seem like a sustainable solution. If you are running terraform apply in automation on a regular basis or even if your want to make an unrelated change in your schedule you definitely do not want to maintain the start time for all the schedules in the same project. |
@stmcallister this is still a problem for us with v1.9.6. In 1.9.5 we get
In 1.9.6 we get this on every single apply
The only workaround right now as mentioned above is to add a lifecycle Are there any other suggested workarounds right now? |
^^ I have also seen the above issue on my end as well (I ended up sync the configurations back into code). |
Issue: PagerDuty#200 When both schedule layer start time (the old one read from PagerDuty API, and the new one read from configuration files) are in the past, there is no need to show Diff as the acutual start time will be updated by PagerDuty API to current time. Otherwise, users will have to sync the configuration files from time to time, when they make irrelevant changes to their schedules (e.g., adding a user) or even no changes at all.
Did #343 fix this? I'm not seeing this behavior anymore, but I'm a bit worried that it's only due to some sort of dumb luck. Would have to go change all our codebase only to have this recur. |
Terraform Version
v0.12.24
Affected Resource(s)
Please list the resources as a list, for example:
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Terraform Configuration Files
Debug Output
Not available.
Panic Output
N/A
Expected Behavior
The plan should not show any changes
Actual Behavior
Spurious diffs were shown
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply -auto-approve
terraform plan
Important Factoids
N/A
The text was updated successfully, but these errors were encountered: