Add Optional Upgrade Window
This PR is to add a set of new optional parameters. These allow a user to specify an upgrade window, and plans will fail to validate until they are inside that upgrade window. This allows us to create a plan and then wait for the controller to pick it up during the window.
A lot of this code was inspired by (or in the case of pkg/upgrade/periodic.go and insideUpgradeWindow(), copied from) https://github.com/flatcar/flatcar-linux-update-operator. As both projects have the same licence I believe this should be compatible.
In the issue tracking this feature, there was discussion of using the timewindow package from kured. Any reason you chose to copy code from flatcar instead of using this library?
I'm also curious why anyone would want this set at a controller level, instead of per-plan.
I must have missed that issue when looking through, or I assumed nobody was looking at it due to the age. If you are developing that I will close this PR down.
If you have a regular maintenance window whether the window is defined in the controller or the plan the end result is the same surely?
Well, if you make it controller-level then anyone who wanted different windows for different plans is out of luck - they'd have to run multiple upgrade controller deployments just to be able to upgrade different things at different times.
I could see allowing for a default upgrade window, in addition to allowing individual plans to have their own window, or opt out of a window entirely if they can run whenever - but only having a single system-wide window does not seem very flexible, and the SUC is intended to be all about flexibility.
I don't believe we have anyone working on it at the moment, but if you wanted to update this PR to function as discussed, that would definitely be appreciated!