From ddd03613bafa0ae32d1dc1367f22165cf12bceb3 Mon Sep 17 00:00:00 2001 From: xuzhonghu Date: Fri, 10 May 2019 10:38:43 +0800 Subject: [PATCH] add LastTransitionTime --- pkg/apis/batch/v1alpha1/job.go | 4 ++++ pkg/apis/batch/v1alpha1/zz_generated.deepcopy.go | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/apis/batch/v1alpha1/job.go b/pkg/apis/batch/v1alpha1/job.go index fb6b8d03656..88694906ece 100644 --- a/pkg/apis/batch/v1alpha1/job.go +++ b/pkg/apis/batch/v1alpha1/job.go @@ -227,6 +227,10 @@ type JobState struct { // +optional Phase JobPhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase"` + // Last time the condition transit from one phase to another. + // +optional + LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"` + // Unique, one-word, CamelCase reason for the phase's last transition. // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,2,opt,name=reason"` diff --git a/pkg/apis/batch/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/batch/v1alpha1/zz_generated.deepcopy.go index 2ed790063e6..7fd00a4301a 100644 --- a/pkg/apis/batch/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/batch/v1alpha1/zz_generated.deepcopy.go @@ -147,6 +147,7 @@ func (in *JobSpec) DeepCopy() *JobSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *JobState) DeepCopyInto(out *JobState) { *out = *in + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) return } @@ -163,7 +164,7 @@ func (in *JobState) DeepCopy() *JobState { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *JobStatus) DeepCopyInto(out *JobStatus) { *out = *in - out.State = in.State + in.State.DeepCopyInto(&out.State) if in.ControlledResources != nil { in, out := &in.ControlledResources, &out.ControlledResources *out = make(map[string]string, len(*in))