rollout

package
v0.0.0-...-c49be44 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StableRevisionAnnotation              = "rollout.cloud.run/stableRevision"
	CandidateRevisionAnnotation           = "rollout.cloud.run/candidateRevision"
	LastFailedCandidateRevisionAnnotation = "rollout.cloud.run/lastFailedCandidateRevision"
	LastRolloutAnnotation                 = "rollout.cloud.run/lastRollout"
	LastHealthReportAnnotation            = "rollout.cloud.run/lastHealthReport"
)

Annotations name for information related to the rollout.

View Source
const (
	StableTag    = "stable"
	CandidateTag = "candidate"
	LatestTag    = "latest"
)

Automatic tags.

Variables

This section is empty.

Functions

func DetectCandidateRevisionName

func DetectCandidateRevisionName(svc *run.Service, stable string) string

DetectCandidateRevisionName attempts to deduce what revision could be considered a candidate.

func DetectStableRevisionName

func DetectStableRevisionName(svc *run.Service) string

DetectStableRevisionName returns the stable revision of the Cloud Run service.

It first checks if there's a revision with the tag "stable". If such a revision does not exist, it checks for a revision with 100% of the traffic and considers it stable.

Types

type Rollout

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

Rollout is the rollout manager.

func New

func New(ctx context.Context, metricsProvider metrics.Provider, svcRecord *ServiceRecord, strategy config.Strategy) *Rollout

New returns a new rollout manager.

func (*Rollout) Rollout

func (r *Rollout) Rollout() (bool, error)

Rollout handles the gradual rollout.

func (*Rollout) UpdateService

func (r *Rollout) UpdateService(svc *run.Service) (*run.Service, bool, error)

UpdateService changes the traffic configuration for the revisions and update the service.

If successful, it always returns an updated service object (with changes in the traffic and/or annotations) or an unchanged service object if no stable or candidate revision was found. If the traffic configuration changed, the second return value is set to true.

func (*Rollout) WithClient

func (r *Rollout) WithClient(client runapi.Client) *Rollout

WithClient updates the client in the rollout instance.

func (*Rollout) WithClock

func (r *Rollout) WithClock(clock clockwork.Clock) *Rollout

WithClock updates the clock in the rollout instance.

func (*Rollout) WithLogger

func (r *Rollout) WithLogger(logger *logrus.Logger) *Rollout

WithLogger updates the logger in the rollout instance.

type ServiceRecord

type ServiceRecord struct {
	*run.Service
	Project string
	Region  string
}

ServiceRecord holds a service object and information about it.

Jump to

Keyboard shortcuts

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