Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewControlPlane ¶
func NewControlPlane(f NewInterfaceFunc, cli client.Client, recorder record.EventRecorder, release *v1beta1.BatchRelease, newStatus *v1beta1.BatchReleaseStatus, key types.NamespacedName, gvk schema.GroupVersionKind) *realBatchControlPlane
NewControlPlane creates a new release controller with blue-green style to drive batch release state machine
Types ¶
type Interface ¶
type Interface interface {
// BuildController will get workload object and parse workload info,
// and return a initialized controller for workload.
BuildController() (Interface, error)
// GetWorkloadInfo return workload information.
GetWorkloadInfo() *util.WorkloadInfo
// ListOwnedPods fetch the pods owned by the workload.
// Note that we should list pod only if we really need it.
// reserved for future use
ListOwnedPods() ([]*corev1.Pod, error)
// CalculateBatchContext calculate current batch context
// according to release plan and current status of workload.
CalculateBatchContext(release *v1beta1.BatchRelease) (*batchcontext.BatchContext, error)
// Initialize do something before rolling out, for example:
// - pause the workload
// - update: MinReadySeconds, ProgressDeadlineSeconds, Strategy
Initialize(release *v1beta1.BatchRelease) error
// UpgradeBatch upgrade workload according current batch context.
UpgradeBatch(ctx *batchcontext.BatchContext) error
// Finalize do something after rolling out, for example:
// - set pause to false, restore the original setting, delete annotation
Finalize(release *v1beta1.BatchRelease) error
}
type NewInterfaceFunc ¶
type NewInterfaceFunc func(cli client.Client, key types.NamespacedName, gvk schema.GroupVersionKind) Interface
Click to show internal directories.
Click to hide internal directories.