Documentation ¶
Overview ¶
Package rollback contains the code for generating DeploymentConfigs representing rollbacks as well as REST support for API clients.
Index ¶
- type Client
- func (c Client) GenerateRollback(from, to *deployapi.DeploymentConfig, ...) (*deployapi.DeploymentConfig, error)
- func (c Client) GetDeployment(ctx apirequest.Context, name string, options *metav1.GetOptions) (*kapi.ReplicationController, error)
- func (c Client) GetDeploymentConfig(ctx apirequest.Context, name string, options *metav1.GetOptions) (*deployapi.DeploymentConfig, error)
- type DeprecatedREST
- type GeneratorClient
- type REST
- type RollbackGenerator
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 apirequest.Context, name string, options *metav1.GetOptions) (*kapi.ReplicationController, error) DCFn func(ctx apirequest.Context, name string, options *metav1.GetOptions) (*deployapi.DeploymentConfig, error) }
Client provides an implementation of Generator client
func (Client) GenerateRollback ¶
func (c Client) GenerateRollback(from, to *deployapi.DeploymentConfig, spec *deployapi.DeploymentConfigRollbackSpec) (*deployapi.DeploymentConfig, error)
GenerateRollback generates a new deploymentConfig by merging a pair of deploymentConfigs
func (Client) GetDeployment ¶
func (c Client) GetDeployment(ctx apirequest.Context, name string, options *metav1.GetOptions) (*kapi.ReplicationController, error)
GetDeployment returns the deployment with the provided context and name
func (Client) GetDeploymentConfig ¶
func (c Client) GetDeploymentConfig(ctx apirequest.Context, name string, options *metav1.GetOptions) (*deployapi.DeploymentConfig, error)
GetDeployment returns the deploymentConfig with the provided context and name
type DeprecatedREST ¶ added in v1.3.0
type DeprecatedREST struct {
// contains filtered or unexported fields
}
REST provides a rollback generation endpoint. Only the Create method is implemented.
func NewDeprecatedREST ¶ added in v1.3.0
func NewDeprecatedREST(generator GeneratorClient, codec runtime.Codec) *DeprecatedREST
NewDeprecatedREST safely creates a new REST.
func (*DeprecatedREST) Create ¶ added in v1.3.0
func (s *DeprecatedREST) Create(ctx apirequest.Context, obj runtime.Object, _ bool) (runtime.Object, error)
Create generates a new DeploymentConfig representing a rollback.
func (*DeprecatedREST) New ¶ added in v1.3.0
func (s *DeprecatedREST) New() runtime.Object
New creates an empty DeploymentConfigRollback resource
type GeneratorClient ¶
type GeneratorClient interface { GenerateRollback(from, to *deployapi.DeploymentConfig, spec *deployapi.DeploymentConfigRollbackSpec) (*deployapi.DeploymentConfig, error) GetDeployment(ctx apirequest.Context, name string, options *metav1.GetOptions) (*kapi.ReplicationController, error) GetDeploymentConfig(ctx apirequest.Context, name string, options *metav1.GetOptions) (*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.
type RollbackGenerator ¶
type RollbackGenerator interface { // GenerateRollback creates a new deployment config by merging to onto from // based on the options provided by spec. The latestVersion of the result is // unconditionally incremented, as rollback candidates 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. GenerateRollback(from, to *deployapi.DeploymentConfig, spec *deployapi.DeploymentConfigRollbackSpec) (*deployapi.DeploymentConfig, error) }
RollbackGenerator generates a new deployment config by merging a pair of deployment configs in a configurable way.
func NewRollbackGenerator ¶ added in v1.3.0
func NewRollbackGenerator() RollbackGenerator
NewRollbackGenerator returns a new rollback generator.