stepwatcher

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StepsFromTemplateInstance

func StepsFromTemplateInstance(ti *templatev1.TemplateInstance, namespace string, clients client.RESTClients, timeoutChan <-chan CompleteStatus) (map[string]*Step, error)

Types

type BasicStepWatcher

type BasicStepWatcher struct {
	watch.Interface
	// contains filtered or unexported fields
}

type BuildStepWatcher

type BuildStepWatcher BasicStepWatcher

func NewBuildStepWatcher

func NewBuildStepWatcher(namespace, name string, buildclient *buildv1client.BuildV1Client) (*BuildStepWatcher, error)

func (*BuildStepWatcher) Event

func (a *BuildStepWatcher) Event(event watch.Event) (bool, error)

type CompleteStatus

type CompleteStatus int
const (
	CompletedSuccess CompleteStatus = iota
	CompletedTimeout
)

type DeploymentConfigStepWatcher

type DeploymentConfigStepWatcher BasicStepWatcher

func NewDeploymentConfigStepWatcher

func NewDeploymentConfigStepWatcher(namespace, name string, appsclient *appsv1client.AppsV1Client) (*DeploymentConfigStepWatcher, error)

func (*DeploymentConfigStepWatcher) Event

func (a *DeploymentConfigStepWatcher) Event(event watch.Event) (bool, error)

type EndpointsStepWatcher

type EndpointsStepWatcher BasicStepWatcher

func NewEndpointsStepWatcher

func NewEndpointsStepWatcher(namespace, name string, coreclient *corev1client.CoreV1Client) (*EndpointsStepWatcher, error)

func (*EndpointsStepWatcher) Event

func (a *EndpointsStepWatcher) Event(event watch.Event) (bool, error)

type ImageStreamTagStepWatcher

type ImageStreamTagStepWatcher BasicStepWatcher

func NewImageStreamTagStepWatcher

func NewImageStreamTagStepWatcher(namespace, name string, imageclient *imagev1client.ImageV1Client) (*ImageStreamTagStepWatcher, error)

func (*ImageStreamTagStepWatcher) Event

func (a *ImageStreamTagStepWatcher) Event(event watch.Event) (bool, error)

type PersistentVolumeClaimStepWatcher

type PersistentVolumeClaimStepWatcher BasicStepWatcher

func NewPersistentVolumeClaimStepWatcher

func NewPersistentVolumeClaimStepWatcher(namespace, name string, coreclient *corev1client.CoreV1Client) (*PersistentVolumeClaimStepWatcher, error)

func (*PersistentVolumeClaimStepWatcher) Event

type RouteStepWatcher

type RouteStepWatcher BasicStepWatcher

func NewRouteStepWatcher

func NewRouteStepWatcher(namespace, name string, routeclient *routev1client.RouteV1Client) (*RouteStepWatcher, error)

func (*RouteStepWatcher) Event

func (a *RouteStepWatcher) Event(event watch.Event) (bool, error)

type ServiceStepWatcher

type ServiceStepWatcher BasicStepWatcher

func NewServiceStepWatcher

func NewServiceStepWatcher(namespace, name string, coreclient *corev1client.CoreV1Client) (*ServiceStepWatcher, error)

func (*ServiceStepWatcher) Event

func (a *ServiceStepWatcher) Event(event watch.Event) (bool, error)

type Step

type Step struct {
	StepWatcher
	Err        error
	EndTime    time.Time
	Dependents []string
	Prereqs    []string
	Mutex      sync.Mutex
}

func (*Step) Done

func (s *Step) Done(timedOut bool, err error, watchers map[string]*Step)

Done records a completion event for a step, but only if no such completion event was already recorded. There are 3 types of completion events:

  1. The step reached its expected "success" state. If the step flaps back to error and breaks things, we won't notice
  2. The step reached an unrecoverable error state. If the error is corrected (e.g. via manual intervention) we won't notice
  3. The step timed out, and it should check to see if it possibly timed out due to a prerequisite not completing

type StepWatcher

type StepWatcher interface {
	watch.Interface
	// Event examines an event
	// Event returns false,nil when the event doesn't indicate that the task has completed
	// Event returns true,nil when the event indicates that the task completed
	// Event returns false,err on an error that indicates that the task will never complete
	Event(event watch.Event) (bool, error)
}

StepWatcher is just like watch.Interface, except that its Event() can tell when a step is complete

type TemplateInstanceStepWatcher

type TemplateInstanceStepWatcher BasicStepWatcher

func NewTemplateInstanceStepWatcher

func NewTemplateInstanceStepWatcher(namespace string, metadata metav1.ObjectMeta, templateclient *templatev1client.TemplateV1Client) (*TemplateInstanceStepWatcher, error)

func (*TemplateInstanceStepWatcher) Event

func (a *TemplateInstanceStepWatcher) Event(event watch.Event) (bool, error)

Jump to

Keyboard shortcuts

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