Skip to content

Commit

Permalink
Fix phase transition time set
Browse files Browse the repository at this point in the history
  • Loading branch information
hzxuzhonghu committed Apr 30, 2020
1 parent 4afb0c3 commit 7844b42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 0 additions & 3 deletions pkg/controllers/job/state/aborting.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package state

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"volcano.sh/volcano/pkg/apis/bus/v1alpha1"

vcbatch "volcano.sh/volcano/pkg/apis/batch/v1alpha1"
Expand All @@ -43,9 +42,7 @@ func (ps *abortingState) Execute(action v1alpha1.Action) error {
return false
}
status.State.Phase = vcbatch.Aborted
status.State.LastTransitionTime = metav1.Now()
return true

})
}
}
3 changes: 2 additions & 1 deletion pkg/controllers/job/state/pending.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ func (ps *pendingState) Execute(action v1alpha1.Action) error {
return SyncJob(ps.job, func(status *vcbatch.JobStatus) bool {
if ps.job.Job.Spec.MinAvailable <= status.Running+status.Succeeded+status.Failed {
status.State.Phase = vcbatch.Running
return true
}
return true
return false
})
}
}

0 comments on commit 7844b42

Please # to comment.