krane
krane copied to clipboard
Make ResourceWatcher responsible for raising group-status-based errors
Currently the RunnerTask, RestartTask and DeployTask each have some code like this:
raise DeploymentTimeoutError if resources.any(&:deploy_timed_out?)
raise FatalDeploymentError if resources.any?(&:deploy_failed?)
We should see if it could work to move that responsibility to the ResourceWatcher to avoid the duplication. Note that the watcher is already responsible for raising global timeout errors.
I have mixed feelings on if the resource watcher should raise or not. But I definitely think resource watcher should be responsible for checking the overall status of a deployment instead of checking each resource individually. I started down that route in the state machine refactor #303