fix(preheat):handle fail case of preheat in job

Signed-off-by: Steven Zou <szou@vmware.com>
This commit is contained in:
Steven Zou 2020-08-28 17:55:36 +08:00
parent 560eba7bd1
commit d4108e3fac

View File

@ -185,9 +185,15 @@ func (j *Job) Run(ctx job.Context, params job.Parameters) error {
myLogger.Infof("Check preheat progress: %s", s)
// Finished
if s.Status == provider.PreheatingStatusSuccess {
switch s.Status {
case provider.PreheatingStatusFail:
// Fail
return preheatJobRunningError(errors.Errorf("preheat failed: %s", s))
case provider.PreheatingStatusSuccess:
// Finished
return nil
default:
// do nothing, check again
}
if shouldStop() {