-
Notifications
You must be signed in to change notification settings - Fork 375
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
Time parse issue in compareTimeRanges (maintenanceWindow) #2009
Comments
Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as |
/fresh |
Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as |
/fresh |
Hey, @eloo-abi we don't have the time to work on this issue but feel to provide a pull request with a fix. |
Hi,
i guess i have discovered a bug in the comparison logic of the compareTimeRanges code for checking if the maintenanceWindow needs to be updated.
provider-aws/pkg/controller/rds/dbinstance/setup.go
Lines 590 to 616 in 4b536aa
What happened?
The current implementation to check the timeRanges rely on the idea that the weekday in the string ("mon") is parsed into a time object.
But according to the docs this is not the case
https://pkg.go.dev/time#Parse
So its only compared to the hour and minute and not weekday.
This results in a wrong comparison result to update the maintenanceWindow and thus could cause a skipped update if only the weekday of a maintenanceWindow would be changed.
How can we reproduce it?
The following snippet will show the issue with a simplified function of the compareTimeRanges code.
https://go.dev/play/p/n2jRovBJBj5
What environment did it happen in?
Bug in the code
The text was updated successfully, but these errors were encountered: