rollback

package
v0.0.0-...-ea77a8b Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package rollback contains the code for generating DeploymentConfigs representing rollbacks as well as REST support for API clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	GRFn func(from, to *deployapi.DeploymentConfig, spec *deployapi.DeploymentConfigRollbackSpec) (*deployapi.DeploymentConfig, error)
	RCFn func(ctx kapi.Context, name string) (*kapi.ReplicationController, error)
	DCFn func(ctx kapi.Context, name string) (*deployapi.DeploymentConfig, error)
}

Client provides an implementation of Generator client

func (Client) GenerateRollback

GenerateRollback generates a new deploymentConfig by merging a pair of deploymentConfigs

func (Client) GetDeployment

func (c Client) GetDeployment(ctx kapi.Context, name string) (*kapi.ReplicationController, error)

GetDeployment returns the deployment with the provided context and name

func (Client) GetDeploymentConfig

func (c Client) GetDeploymentConfig(ctx kapi.Context, name string) (*deployapi.DeploymentConfig, error)

GetDeployment returns the deploymentConfig with the provided context and name

type GeneratorClient

type GeneratorClient interface {
	GenerateRollback(from, to *deployapi.DeploymentConfig, spec *deployapi.DeploymentConfigRollbackSpec) (*deployapi.DeploymentConfig, error)
	GetDeployment(ctx kapi.Context, name string) (*kapi.ReplicationController, error)
	GetDeploymentConfig(ctx kapi.Context, name string) (*deployapi.DeploymentConfig, error)
}

GeneratorClient defines a local interface to a rollback generator for testability.

type REST

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

REST provides a rollback generation endpoint. Only the Create method is implemented.

func NewREST

func NewREST(generator GeneratorClient, codec runtime.Codec) *REST

NewREST safely creates a new REST.

func (*REST) Create

func (s *REST) Create(ctx kapi.Context, obj runtime.Object) (runtime.Object, error)

Create generates a new DeploymentConfig representing a rollback.

func (*REST) New

func (s *REST) New() runtime.Object

New creates an empty DeploymentConfigRollback resource

type RollbackGenerator

type RollbackGenerator struct{}

RollbackGenerator generates a new DeploymentConfig by merging a pair of DeploymentConfigs in a configurable way.

func (*RollbackGenerator) GenerateRollback

GenerateRollback creates a new DeploymentConfig by merging to onto from based on the options provided by spec. The LatestVersion of the result is unconditionally incremented, as rollback candidates are should be possible to be deployed manually regardless of other system behavior such as triggering.

Any image change triggers on the new config are disabled to prevent triggered deployments from immediately replacing the rollback.

Jump to

Keyboard shortcuts

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