Documentation
¶
Index ¶
- Constants
- type HostName
- type LocatedResourceStatus
- type Locator
- type Mutator
- type Predicate
- type Ref
- func (r *Ref) AddResourceStatus(ref ResourceStatus)
- func (r *Ref) AddTargetResource(ref LocatedResourceStatus)
- func (r *Ref) GetNewVersion(sessionName string) string
- func (r *Ref) GetResources(predicate Predicate) []ResourceStatus
- func (r *Ref) GetTargetHostNames() []HostName
- func (r *Ref) GetTargets(predicate Predicate) []LocatedResourceStatus
- func (r *Ref) GetVersion() string
- func (r *Ref) RemoveResourceStatus(ref ResourceStatus)
- type ResourceAction
- type ResourceStatus
- type Revertor
- type Route
- type SessionContext
Constants ¶
const (
// StrategyExisting holds the name of the existing strategy
StrategyExisting = "existing"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocatedResourceStatus ¶ added in v0.0.2
type LocatedResourceStatus struct { ResourceStatus Labels map[string]string }
LocatedResourceStatus is a ResourceStatus with labels.
func NewLocatedResource ¶ added in v0.0.2
func NewLocatedResource(kind, name string, labels map[string]string) LocatedResourceStatus
NewLocatedResource is a simple helper to create LocatedResourceStatus.
type Locator ¶
type Locator func(SessionContext, *Ref) bool
Locator should attempt to resolve a Ref.Name to a target Named kind, e.g. Deployment, DeploymentConfig. return false if nothing was found.
type Mutator ¶
type Mutator func(SessionContext, *Ref) error
Mutator should create/modify a target Kind as required as needed * Add status to Ref for storage, failed or not.
type Predicate ¶ added in v0.0.4
type Predicate func(ResourceStatus) bool
Predicate base function to filter Resources.
type Ref ¶
type Ref struct { Name string Namespace string Strategy string Args map[string]string Targets []LocatedResourceStatus ResourceStatuses []ResourceStatus }
Ref references to a single Reference, e.g. Deployment, DeploymentConfig or GitRepo.
func (*Ref) AddResourceStatus ¶
func (r *Ref) AddResourceStatus(ref ResourceStatus)
AddResourceStatus adds the status of an involved Resource to this ref.
func (*Ref) AddTargetResource ¶ added in v0.0.3
func (r *Ref) AddTargetResource(ref LocatedResourceStatus)
AddTargetResource adds the status of an involved Resource to this ref.
func (*Ref) GetNewVersion ¶ added in v0.0.3
GetNewVersion returns the new updated version name.
func (*Ref) GetResources ¶ added in v0.0.4
func (r *Ref) GetResources(predicate Predicate) []ResourceStatus
GetResources use a Predicate to filter the ResourceStatus.
func (*Ref) GetTargetHostNames ¶ added in v0.0.3
GetTargetHostNames returns a list of Host names that the target Deployment can be reached under.
func (*Ref) GetTargets ¶ added in v0.0.4
func (r *Ref) GetTargets(predicate Predicate) []LocatedResourceStatus
GetTargets use a Predicate to filter the LocatedResourceStatus.
func (*Ref) GetVersion ¶ added in v0.0.3
GetVersion returns the existing version name.
func (*Ref) RemoveResourceStatus ¶
func (r *Ref) RemoveResourceStatus(ref ResourceStatus)
RemoveResourceStatus removes the status of an involved Resource to this ref.
type ResourceAction ¶
type ResourceAction string
ResourceAction describes which type of operation was done/attempted to the target resource. Used to determine how to undo it.
const ( // ActionCreated imply the whole Named Kind was created and can be deleted ActionCreated ResourceAction = "created" // ActionModified imply the Named Kind has been modified and needs to be reverted to get back to original state ActionModified ResourceAction = "modified" // ActionFailed imply what ever was attempted failed. Assume current state is ok in clean up? ActionFailed ResourceAction = "failed" // ActionLocated imply the resource was found, but nothing was changed. ActionLocated ResourceAction = "located" )
type ResourceStatus ¶
type ResourceStatus struct { Kind string Name string // created, mutated, failed Action ResourceAction Prop map[string]string }
ResourceStatus holds information about the resources created/changed to fulfill a Ref.
type Revertor ¶
type Revertor func(SessionContext, *Ref) error
Revertor should delete/modify a target Kind to return to the original state after a Mutator * Remove status from Ref unless there is a failure that requires retry.