| 32 | ) |
| 33 | |
| 34 | type OpsHandler interface { |
| 35 | // Action The action duration should be short. if it fails, it will be reconciled by the OpsRequest controller. |
| 36 | // Do not patch OpsRequest status in this function with k8s client, just modify the status of ops. |
| 37 | // The opsRequest controller will patch it to the k8s apiServer. |
| 38 | Action(reqCtx intctrlutil.RequestCtx, cli client.Client, opsResource *OpsResource) error |
| 39 | |
| 40 | // ReconcileAction loops till the operation is completed. |
| 41 | // return OpsRequest.status.phase and requeueAfter time. |
| 42 | ReconcileAction(reqCtx intctrlutil.RequestCtx, cli client.Client, opsResource *OpsResource) (opsv1alpha1.OpsPhase, time.Duration, error) |
| 43 | |
| 44 | // ActionStartedCondition appends to OpsRequest.status.conditions when start performing Action function |
| 45 | ActionStartedCondition(reqCtx intctrlutil.RequestCtx, cli client.Client, opsRes *OpsResource) (*metav1.Condition, error) |
| 46 | |
| 47 | // SaveLastConfiguration saves last configuration to the OpsRequest.status.lastConfiguration, |
| 48 | // and this method will be executed together when opsRequest in running. |
| 49 | SaveLastConfiguration(reqCtx intctrlutil.RequestCtx, cli client.Client, opsResource *OpsResource) error |
| 50 | } |
| 51 | |
| 52 | type OpsBehaviour struct { |
| 53 | FromClusterPhases []appsv1.ClusterPhase |
no outgoing calls
no test coverage detected
searching dependent graphs…