patchOpsRequestToCreating patches OpsRequest.status.phase to Running
(reqCtx intctrlutil.RequestCtx, cli client.Client, opsRes *OpsResource, opsDeepCoy *opsv1alpha1.OpsRequest, opsHandler OpsHandler)
| 153 | |
| 154 | // patchOpsRequestToCreating patches OpsRequest.status.phase to Running |
| 155 | func patchOpsRequestToCreating(reqCtx intctrlutil.RequestCtx, |
| 156 | cli client.Client, |
| 157 | opsRes *OpsResource, |
| 158 | opsDeepCoy *opsv1alpha1.OpsRequest, |
| 159 | opsHandler OpsHandler) error { |
| 160 | var condition *metav1.Condition |
| 161 | validatePassCondition := opsv1alpha1.NewValidatePassedCondition(opsRes.OpsRequest.Name) |
| 162 | condition, err := opsHandler.ActionStartedCondition(reqCtx, cli, opsRes) |
| 163 | if err != nil { |
| 164 | return err |
| 165 | } |
| 166 | return PatchOpsStatusWithOpsDeepCopy(reqCtx.Ctx, cli, opsRes, opsDeepCoy, opsv1alpha1.OpsCreatingPhase, validatePassCondition, condition) |
| 167 | } |
| 168 | |
| 169 | // isOpsRequestFailedPhase checks the OpsRequest phase is Failed |
| 170 | func isOpsRequestFailedPhase(opsRequestPhase opsv1alpha1.OpsPhase) bool { |
no test coverage detected
searching dependent graphs…