Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
Added cron scheduling feature to allow for more complex sleep scheduling.
Changes
DailyWindowandCronSchedule.DailyWindowuses the same logic as the original with awakeTimeandsleepTimein the "3:04pm" format.CronSchedulehas awakeScheduleand asleepSchedulethat follows the typical cron style '* * * * *' format.SleepScheduleReconcilerconstructor to allow for easier mocking when testing.DailyWindoworCronSchedule.Timezoneactually optional by removing the kubebuilder validator and allowing the controller logic to use thetime.LoadLocationdefault UTC if no timezone is specified.NowandLocationfrom theSleepScheduleDatasinceNowwas not being used andLocationredundant toTimezonein its application.Notes
CronSchedule, if two times (wake and sleep) are the same, it implicitly defaults to being awake.DailyWindow, if two times (wake and sleep) are the same, it implicitly defaults to being asleep. (although this is very unlikely/makes little sense, there is currently nothing preventing someone from doing this)Suggestions
DailyWindowdoes not support military time and only "3:04pm" format, but we can easily add to the time formats accepted to make this more flexible. (e.g. 15:04, 3:04 PM, etc...)