Documentation ¶
Index ¶
- Variables
- func IsActionFinished(actionProgress ActionProgress) bool
- func IsCandidateOpsFinished(candidate *OpsCandidate) bool
- func IsCandidateOpsPending(candidate *OpsCandidate) bool
- func IsCandidateServiceAvailable(candidate *OpsCandidate) bool
- func NewLifecycleAdapter(ojName, lifecycleType string) podopslifecycle.LifecycleAdapter
- func RegisterAction(action string, handler ActionHandler, enablePodOpsLifecycle bool)
- type ActionHandler
- type ActionProgress
- type GenericLifecycleAdapter
- func (g GenericLifecycleAdapter) AllowMultiType() bool
- func (g GenericLifecycleAdapter) GetID() string
- func (g GenericLifecycleAdapter) GetType() podopslifecycle.OperationType
- func (g GenericLifecycleAdapter) WhenBegin(_ client.Object) (bool, error)
- func (g GenericLifecycleAdapter) WhenFinish(_ client.Object) (bool, error)
- type OpsCandidate
Constants ¶
This section is empty.
Variables ¶
View Source
var ActionRegistry map[string]ActionHandler
ActionRegistry is a map of operationjob.spec.action to actionHandler
View Source
var EnablePodOpsLifecycleRegistry map[string]bool
EnablePodOpsLifecycleRegistry is a map of operationjob.spec.action to enablePodOpsLifecycle
Functions ¶
func IsActionFinished ¶ added in v0.6.0
func IsActionFinished(actionProgress ActionProgress) bool
func IsCandidateOpsFinished ¶
func IsCandidateOpsFinished(candidate *OpsCandidate) bool
func IsCandidateOpsPending ¶
func IsCandidateOpsPending(candidate *OpsCandidate) bool
func IsCandidateServiceAvailable ¶ added in v0.6.0
func IsCandidateServiceAvailable(candidate *OpsCandidate) bool
func NewLifecycleAdapter ¶
func NewLifecycleAdapter(ojName, lifecycleType string) podopslifecycle.LifecycleAdapter
func RegisterAction ¶
func RegisterAction(action string, handler ActionHandler, enablePodOpsLifecycle bool)
RegisterAction will register an operationJob action with handler and lifecycleAdapter Note: if enablePodOpsLifecycle=false, this operation will be done directly, ignoring podOpsLifecycle
Types ¶
type ActionHandler ¶
type ActionHandler interface { // Setup sets up action with manager in AddToMgr, i.e., watch, cache... Setup(controller.Controller, *mixin.ReconcilerMixin) error // OperateTarget do real operation to target OperateTarget(context.Context, *OpsCandidate, *appsv1alpha1.OperationJob) error // GetOpsProgress returns target's current opsStatus, e.g., progress, reason, message GetOpsProgress(context.Context, *OpsCandidate, *appsv1alpha1.OperationJob) (progress ActionProgress, err error) // ReleaseTarget releases the target from operation when the operationJob is deleted ReleaseTarget(context.Context, *OpsCandidate, *appsv1alpha1.OperationJob) error }
func GetActionResources ¶
func GetActionResources(action string) (ActionHandler, bool)
type ActionProgress ¶
type ActionProgress string
const ( ActionProgressProcessing ActionProgress = "Processing" ActionProgressFailed ActionProgress = "Failed" ActionProgressSucceeded ActionProgress = "Succeeded" )
type GenericLifecycleAdapter ¶
type GenericLifecycleAdapter struct { ID string Type podopslifecycle.OperationType }
func (GenericLifecycleAdapter) AllowMultiType ¶
func (g GenericLifecycleAdapter) AllowMultiType() bool
func (GenericLifecycleAdapter) GetID ¶
func (g GenericLifecycleAdapter) GetID() string
func (GenericLifecycleAdapter) GetType ¶
func (g GenericLifecycleAdapter) GetType() podopslifecycle.OperationType
func (GenericLifecycleAdapter) WhenBegin ¶
func (g GenericLifecycleAdapter) WhenBegin(_ client.Object) (bool, error)
func (GenericLifecycleAdapter) WhenFinish ¶
func (g GenericLifecycleAdapter) WhenFinish(_ client.Object) (bool, error)
type OpsCandidate ¶
type OpsCandidate struct { *corev1.Pod PodName string Containers []string OpsStatus *appsv1alpha1.OpsStatus }
func DecideCandidateByPartition ¶
func DecideCandidateByPartition(instance *appsv1alpha1.OperationJob, candidates []*OpsCandidate) []*OpsCandidate
Click to show internal directories.
Click to hide internal directories.