releasemanager

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Overview

Package releasemanager is a generated GoMock package.

Package releasemanager is a generated GoMock package.

Index

Constants

View Source
const (
	DeployingTimeout = time.Duration(2) * time.Hour
)
View Source
const Threshold = 0.95

Variables

View Source
var AllStates []string

Functions

func Add

func Add(mgr manager.Manager, c utils.Config) error

Add creates a new ReleaseManager Controller and adds it to the Manager. The Manager will set fields on the Controller and Start it when the Manager is Started.

func ExpectedReleaseLatency

func ExpectedReleaseLatency(i Incarnation, max uint32) time.Duration

func HasFailed

func HasFailed(d Deployment) bool

func NextIncrement

func NextIncrement(i Incarnation, max uint32) uint32

func Scale

func Scale(i Incarnation, max uint32, t time.Time) uint32

Types

type ClusterInfo

type ClusterInfo struct {
	Name          string
	Live          bool
	ScalingFactor float64
}

ClusterInfo records info needed to compute expected replicas

type ClusterInfoList

type ClusterInfoList []ClusterInfo

ClusterInfoList is info for all relevent active clusters

func (*ClusterInfoList) ClusterCount

func (c *ClusterInfoList) ClusterCount(liveness bool) int

ClusterCount returns the number of clusters by liveness (live vs. standby)

func (*ClusterInfoList) ExpectedReplicaCount

func (c *ClusterInfoList) ExpectedReplicaCount(liveness bool, count int) int

ExpectedReplicaCount returns expected total replicas by liveness adjusted for scalingFactors

type ConfigMapList

type ConfigMapList struct {
	Item *corev1.ConfigMapList
}

func NewConfigMapList

func NewConfigMapList() *ConfigMapList

func (*ConfigMapList) GetItems

func (s *ConfigMapList) GetItems() (r []runtime.Object)

func (*ConfigMapList) GetList

func (s *ConfigMapList) GetList() (r runtime.Object)

type Controller

type Controller interface {
	// contains filtered or unexported methods
}

Controller is incarnations interface into the outside scope

type Deployment

type Deployment interface {
	// contains filtered or unexported methods
}

type DeploymentStateManager

type DeploymentStateManager struct {
	// contains filtered or unexported fields
}

func NewDeploymentStateManager

func NewDeploymentStateManager(deployment Deployment, lastUpdated *time.Time) *DeploymentStateManager

type ExternalTestStatus

type ExternalTestStatus int

ExternalTestStatus summarizes a RevisionTarget's ExternalTest spec field.

const (
	ExternalTestUnknown ExternalTestStatus = iota
	ExternalTestDisabled
	ExternalTestPending
	ExternalTestStarted
	ExternalTestFailed
	ExternalTestSucceeded
)

func TargetExternalTestStatus

func TargetExternalTestStatus(target *picchuv1alpha1.RevisionTarget) ExternalTestStatus

func (ExternalTestStatus) Enabled

func (s ExternalTestStatus) Enabled() bool

func (ExternalTestStatus) Finished

func (s ExternalTestStatus) Finished() bool

type HorizontalPodAutoscalerList

type HorizontalPodAutoscalerList struct {
	Item *autoscaling.HorizontalPodAutoscalerList
}

func NewHorizontalPodAutoscalerList

func NewHorizontalPodAutoscalerList() *HorizontalPodAutoscalerList

func (*HorizontalPodAutoscalerList) GetItems

func (s *HorizontalPodAutoscalerList) GetItems() (r []runtime.Object)

func (*HorizontalPodAutoscalerList) GetList

func (s *HorizontalPodAutoscalerList) GetList() (r runtime.Object)

type Incarnation

type Incarnation struct {
	// contains filtered or unexported fields
}

Incarnation respresents an applied revision

func NewIncarnation

func NewIncarnation(controller Controller, tag string, revision *picchuv1alpha1.Revision, log logr.Logger, di *observe.DeploymentInfo, config utils.Config) *Incarnation

NewIncarnation creates a new Incarnation

func (*Incarnation) CreatedOn

func (i *Incarnation) CreatedOn() time.Time

CreatedOn returns the incarnations git timestamp

func (*Incarnation) State

func (i *Incarnation) State() string

State returns the incarnations current state

func (*Incarnation) TTL

func (i *Incarnation) TTL() time.Duration

TTL returns the incarnations release ttl

func (*Incarnation) Tag

func (i *Incarnation) Tag() string

Tag is the revision tag

type IncarnationCollection

type IncarnationCollection struct {
	// contains filtered or unexported fields
}

IncarnationCollection helps us collect and select appropriate incarnations

type IncarnationController

type IncarnationController struct {
	// contains filtered or unexported fields
}

type Incarnations

type Incarnations interface {
	// contains filtered or unexported methods
}

type List

type List interface {
	GetItems() []runtime.Object
	GetList() runtime.Object
}

type MockDeployment

type MockDeployment struct {
	// contains filtered or unexported fields
}

MockDeployment is a mock of Deployment interface

func NewMockDeployment

func NewMockDeployment(ctrl *gomock.Controller) *MockDeployment

NewMockDeployment creates a new mock instance

func (*MockDeployment) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

type MockDeploymentMockRecorder

type MockDeploymentMockRecorder struct {
	// contains filtered or unexported fields
}

MockDeploymentMockRecorder is the mock recorder for MockDeployment

type MockIncarnations

type MockIncarnations struct {
	// contains filtered or unexported fields
}

MockIncarnations is a mock of Incarnations interface

func NewMockIncarnations

func NewMockIncarnations(ctrl *gomock.Controller) *MockIncarnations

NewMockIncarnations creates a new mock instance

func (*MockIncarnations) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

type MockIncarnationsMockRecorder

type MockIncarnationsMockRecorder struct {
	// contains filtered or unexported fields
}

MockIncarnationsMockRecorder is the mock recorder for MockIncarnations

type ReconcileReleaseManager

type ReconcileReleaseManager struct {
	// contains filtered or unexported fields
}

ReconcileReleaseManager reconciles a ReleaseManager object

func (*ReconcileReleaseManager) Reconcile

Reconcile reads that state of the cluster for a ReleaseManager object and makes changes based on the state read and what is in the ReleaseManager.Spec

type ReplicaSetList

type ReplicaSetList struct {
	Item *appsv1.ReplicaSetList
}

func NewReplicaSetList

func NewReplicaSetList() *ReplicaSetList

func (*ReplicaSetList) GetItems

func (s *ReplicaSetList) GetItems() (r []runtime.Object)

func (*ReplicaSetList) GetList

func (s *ReplicaSetList) GetList() (r runtime.Object)

type ResourceSyncer

type ResourceSyncer struct {
	// contains filtered or unexported fields
}

type ScalableTargetAdapter

type ScalableTargetAdapter struct {
	Incarnation
}

func (*ScalableTargetAdapter) CanRampTo

func (s *ScalableTargetAdapter) CanRampTo(desiredPercent uint32) bool

CanRampTo returns true if the target is considered ready to be scaled to the next increment.

func (*ScalableTargetAdapter) CurrentPercent

func (s *ScalableTargetAdapter) CurrentPercent() uint32

func (*ScalableTargetAdapter) LastUpdated

func (s *ScalableTargetAdapter) LastUpdated() time.Time

func (*ScalableTargetAdapter) PeakPercent

func (s *ScalableTargetAdapter) PeakPercent() uint32

func (*ScalableTargetAdapter) ReleaseInfo

func (s *ScalableTargetAdapter) ReleaseInfo() picchu.ReleaseInfo

type SecretList

type SecretList struct {
	Item *corev1.SecretList
}

func NewSecretList

func NewSecretList() *SecretList

func (*SecretList) GetItems

func (s *SecretList) GetItems() (r []runtime.Object)

func (*SecretList) GetList

func (s *SecretList) GetList() (r runtime.Object)

type State

type State string

func Canaried

func Canaried(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

func Canarying

func Canarying(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

func Created

func Created(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

func Deleted

func Deleted(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

func Deleting

func Deleting(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

func Deployed

func Deployed(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

func Deploying

func Deploying(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

func Failed

func Failed(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

func Failing

func Failing(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

func PendingRelease

func PendingRelease(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

func PendingTest

func PendingTest(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

func Released

func Released(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

func Releasing

func Releasing(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

func Retired

func Retired(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

func Retiring

func Retiring(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

func Tested

func Tested(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

func Testing

func Testing(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

func Timingout

func Timingout(ctx context.Context, deployment Deployment, lastUpdated *time.Time) (State, error)

Timingout state is responsible for cleaning up a timing out release

type StateHandler

type StateHandler func(context.Context, Deployment, *time.Time) (State, error)

Directories

Path Synopsis
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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