Documentation
¶
Index ¶
Constants ¶
This section is empty.
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
func (*LocatedResourceStatus) GetHostName ¶ added in v0.0.2
func (l *LocatedResourceStatus) GetHostName() string
GetHostName returns the targets host name
func (*LocatedResourceStatus) GetNewVersion ¶ added in v0.0.2
func (l *LocatedResourceStatus) GetNewVersion(sessionName string) string
GetNewVersion returns the new updated version name
func (*LocatedResourceStatus) GetVersion ¶ added in v0.0.2
func (l *LocatedResourceStatus) GetVersion() string
GetVersion returns the existing version name
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 Ref ¶
type Ref struct { Name string Strategy string Args map[string]string Target 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) GetResourceStatus ¶
func (r *Ref) GetResourceStatus(kind string) []ResourceStatus
GetResourceStatus returns a array of involved Resources based on a k8s Kind
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 }
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