-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Relax diff on maintenance_policy.daily_maintenance_window.start_time #726
Relax diff on maintenance_policy.daily_maintenance_window.start_time #726
Conversation
If the maintenance window has been set outside of Terraform to a time with a single-digit hour (such as 1:00), and the terraform definition is set to the same hour but with a leading zero as per validation (i.e. 01:00), do not consider the time to be changed (as we currently don't support update on this property). Fixes hashicorp#719
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for improving this resource. I only have one small suggestion around testing.
google/utils_test.go
Outdated
func TestRfc3339TimeDiffSuppress(t *testing.T) { | ||
old := "2:00" | ||
new := "02:00" | ||
if rfc3339TimeDiffSuppress("time", old, new, nil) == false { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add also a test case to make sure it doesn't suppress a diff for the following cases:
2:00 and 3:00
02:00 and 3:00
2:00 and 03:00
I suggest you use a table driven test approach like TestIpCidrRangeDiffSuppress
in this file.
Added more test cases as requested. I've removed my assumption that the 'new' value will always have a two-digit hour, in case that validation restriction gets lifted (or used somewhere else where it's not enforced). |
Thanks Michael! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Fixes #719.
Add a DiffSuppressFunc to start_time.
I can't see if there's a useful way to test this in the unit test and I can't see how I'd trigger this condition through an acceptance test case. Ideas & advice welcome!