MCPcopy
hub / github.com/apecloud/kubeblocks / OpsHandler

Interface OpsHandler

pkg/operations/type.go:34–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32)
33
34type 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
52type OpsBehaviour struct {
53 FromClusterPhases []appsv1.ClusterPhase

Implementers 14

BackupOpsHandlerpkg/operations/backup.go
StopOpsHandlerpkg/operations/stop.go
StartOpsHandlerpkg/operations/start.go
ExposeOpsHandlerpkg/operations/expose.go
reconfigureActionpkg/operations/reconfigure.go
restartOpsHandlerpkg/operations/restart.go
verticalScalingHandlerpkg/operations/vertical_scaling.go
horizontalScalingOpsHandlerpkg/operations/horizontal_scaling.go
CustomOpsHandlerpkg/operations/custom.go
rebuildInstanceOpsHandlerpkg/operations/rebuild_instance.go
volumeExpansionOpsHandlerpkg/operations/volume_expansion.go
RestoreOpsHandlerpkg/operations/restore.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…