Skip to content

Commit d4408f2

Browse files
Merge pull request volcano-sh#53 from HecarimV/add-job-conditions
add job start/end time to job status
2 parents 70005b2 + eb77927 commit d4408f2

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

pkg/apis/batch/v1alpha1/job.go

+15
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,12 @@ type JobStatus struct {
317317
// The resources that controlled by this job, e.g. Service, ConfigMap
318318
// +optional
319319
ControlledResources map[string]string `json:"controlledResources,omitempty" protobuf:"bytes,11,opt,name=controlledResources"`
320+
321+
// Which conditions caused the current job state.
322+
// +optional
323+
// +patchMergeKey=status
324+
// +patchStrategy=merge
325+
Conditions []JobCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"status" protobuf:"bytes,12,rep,name=conditions"`
320326
}
321327

322328
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@@ -329,3 +335,12 @@ type JobList struct {
329335

330336
Items []Job `json:"items" protobuf:"bytes,2,rep,name=items"`
331337
}
338+
339+
// JobCondition contains details for the current condition of this job.
340+
type JobCondition struct {
341+
// Status is the new phase of job after performing the state's action.
342+
Status JobPhase `json:"status" protobuf:"bytes,1,opt,name=status,casttype=JobPhase"`
343+
// Last time the condition transitioned from one phase to another.
344+
// +optional
345+
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,2,opt,name=lastTransitionTime"`
346+
}

pkg/apis/batch/v1alpha1/zz_generated.deepcopy.go

+27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)