Documentation ¶
Index ¶
- func AddLabel(po *corev1.Pod, k, v string) bool
- func AllowOps(adapter LifecycleAdapter, operationDelaySeconds int32, obj client.Object) (requeueAfter *time.Duration, allow bool)
- func Begin(c client.Client, adapter LifecycleAdapter, obj client.Object, ...) (updated bool, err error)
- func DefaultUpdateAll(pod client.Object, updateFunc ...UpdateFunc) (updated bool, err error)
- func Finish(c client.Client, adapter LifecycleAdapter, obj client.Object, ...) (updated bool, err error)
- func IsDuringOps(adapter LifecycleAdapter, obj client.Object) bool
- type LifecycleAdapter
- type OperationType
- type UpdateFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowOps ¶
func AllowOps(adapter LifecycleAdapter, operationDelaySeconds int32, obj client.Object) (requeueAfter *time.Duration, allow bool)
AllowOps is used to check whether the PodOpsLifecycle phase is in UPGRADE to do following operations.
func Begin ¶
func Begin(c client.Client, adapter LifecycleAdapter, obj client.Object, updateFunc ...UpdateFunc) (updated bool, err error)
Begin is used for an CRD Operator to begin a lifecycle
func DefaultUpdateAll ¶
func DefaultUpdateAll(pod client.Object, updateFunc ...UpdateFunc) (updated bool, err error)
func Finish ¶
func Finish(c client.Client, adapter LifecycleAdapter, obj client.Object, updateFunc ...UpdateFunc) (updated bool, err error)
Finish is used for an CRD Operator to finish a lifecycle
func IsDuringOps ¶
func IsDuringOps(adapter LifecycleAdapter, obj client.Object) bool
IsDuringOps decides whether the Pod is during ops or not DuringOps means the Pod's OpsLifecycle phase is in or after PreCheck phase and before Finish phase.
Types ¶
type LifecycleAdapter ¶
type LifecycleAdapter interface { // GetID indicates ID of one PodOpsLifecycle GetID() string // GetType indicates type for an Operator GetType() OperationType // AllowMultiType indicates whether multiple IDs which have the same Type are allowed AllowMultiType() bool // WhenBegin will be executed when begin a lifecycle WhenBegin(pod client.Object) (bool, error) // WhenFinish will be executed when finish a lifecycle WhenFinish(pod client.Object) (bool, error) }
LifecycleAdapter helps CRD Operators to easily access PodOpsLifecycle
type OperationType ¶
type OperationType string
var ( OpsLifecycleTypeUpdate OperationType = "update" OpsLifecycleTypeScaleIn OperationType = "scale-in" OpsLifecycleTypeDelete OperationType = "delete" )
Click to show internal directories.
Click to hide internal directories.