@@ -17,6 +17,8 @@ limitations under the License.
1717package v1alpha1
1818
1919import (
20+ "fmt"
21+
2022 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2123)
2224
@@ -35,11 +37,10 @@ const (
3537type OperationProgress string
3638
3739const (
38- OperationProgressPending OperationProgress = "Pending"
39- OperationProgressProcessing OperationProgress = "Processing"
40- OperationProgressFinishingOpsLifecycle OperationProgress = "FinishingOpsLifecycle"
41- OperationProgressFailed OperationProgress = "Failed"
42- OperationProgressSucceeded OperationProgress = "Succeeded"
40+ OperationProgressPending OperationProgress = "Pending"
41+ OperationProgressProcessing OperationProgress = "Processing"
42+ OperationProgressFailed OperationProgress = "Failed"
43+ OperationProgressSucceeded OperationProgress = "Succeeded"
4344)
4445
4546// OperationJobSpec defines the desired state of OperationJob
@@ -127,15 +128,29 @@ type OpsStatus struct {
127128 // +optional
128129 Progress OperationProgress `json:"progress,omitempty"`
129130
130- // reason for current operation progress
131+ // extra info of the target operating progress
131132 // +optional
132- Reason string `json:"reason,omitempty"`
133+ ExtraInfo map [string ]string `json:"extraInfo,omitempty"`
134+
135+ // error indicates the error info of progressing
136+ // +optional
137+ Error * CodeReasonMessage `json:"error,omitempty"`
138+ }
133139
134- // message displays detail of reason
140+ type CodeReasonMessage struct {
141+ // A human-readable short word
142+ // +optional
143+ Reason string `json:"reason,omitempty"`
144+ // A human-readable message indicating details about the transition.
135145 // +optional
136146 Message string `json:"message,omitempty"`
137147}
138148
149+ // Error implements error.
150+ func (c * CodeReasonMessage ) Error () string {
151+ return fmt .Sprintf ("err: reason=%q, message=%q" , c .Reason , c .Message )
152+ }
153+
139154// +k8s:openapi-gen=true
140155// +genclient
141156// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
0 commit comments