partitionstyle

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 16 Imported by: 1

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 partitioned-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.
	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:
	// - claim the workload is under our control;
	// - other things related with specific type of workload, such as 100% partition settings.
	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:
	// - free the stable workload from rollout control;
	// - resume workload if we need.
	Finalize(release *v1beta1.BatchRelease) error
}

type NewInterfaceFunc

type NewInterfaceFunc func(cli client.Client, key types.NamespacedName, gvk schema.GroupVersionKind) Interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL