canarystyle

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: 11 Imported by: 0

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) *realCanaryController

NewControlPlane creates a new release controller to drive batch release state machine

Types

type CanaryInterface

type CanaryInterface interface {
	// GetCanaryInfo return the information about canary workload
	GetCanaryInfo() *util.WorkloadInfo
	// UpgradeBatch upgrade canary workload according to current batch context
	UpgradeBatch(*batchcontext.BatchContext) error
	// Create creates canary workload before rolling out
	Create(controller *v1beta1.BatchRelease) error
	// Delete deletes canary workload after rolling out
	Delete(controller *v1beta1.BatchRelease) error
}

CanaryInterface contains the methods about canary workload

type Interface

type Interface interface {
	CanaryInterface
	StableInterface
	// BuildStableController will get stable workload object and parse
	// stable workload info, and return a controller for stable workload.
	BuildStableController() (StableInterface, error)
	// BuildCanaryController will get canary workload object and parse
	// canary workload info, and return a controller for canary workload.
	BuildCanaryController(release *v1beta1.BatchRelease) (CanaryInterface, error)
	// CalculateBatchContext calculate the current batch context according to
	// our release plan and the statues of stable workload and canary workload.
	CalculateBatchContext(release *v1beta1.BatchRelease) *batchcontext.BatchContext
}

type NewInterfaceFunc

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

type StableInterface

type StableInterface interface {
	// GetStableInfo return the information about stable workload
	GetStableInfo() *util.WorkloadInfo
	// Initialize claim the stable workload is under rollout control
	Initialize(controller *v1beta1.BatchRelease) error
	// Finalize do something after rolling out, for example:
	// - free the stable workload from rollout control;
	// - resume stable workload and wait all pods updated if we need.
	Finalize(controller *v1beta1.BatchRelease) error
}

StableInterface contains the methods about stable workload

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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