workflow

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// JobHasSLA indicate that a job has SLA assertion. Used to deregister the alert once the job has finished.
	// Used as [JobHasSLA]: [alertID]
	JobHasSLA = "frisbee.io/sla"

	// SLAViolationFired indicate that a Grafana alert has been fired.
	// Used as [SLAViolationFired]: [alertID]
	SLAViolationFired = "sla.frisbee.io/fire"

	// SLAViolationInfo include information about the fired Grafana Alert.
	// Used as [SlaViolationINfo]: [string]
	SLAViolationInfo = "sla.frisbee.io/info"
)

Variables

This section is empty.

Functions

func AssertSLA

func AssertSLA(w *v1alpha1.Workflow) (string, bool)

func AssertState

func AssertState(expr string, state *BuiltinState) error

AssertState enforces user-driven decisions as to when the test has passed or has fail. if it has failed, it updates the workflow status and returns true to indicate that the status has been modified.

func GetNextLogicalJob

func GetNextLogicalJob(obj metav1.Object, all v1alpha1.ActionList, gs lifecycle.Classifier, scheduled map[string]metav1.Time) (v1alpha1.ActionList, time.Time)

GetNextLogicalJob returns a list of jobs that meet the logical and time constraints. That is, either the job has no dependencies, or the dependencies are met.

It is possible for the logical dependencies to be met, but the timeout not yet expired. If at least one action exists, when the workflow is updated it will trigger another reconciliation cycle. However, if there are no actions, the workflow will stop the reconciliation cycle, and we will miss the next timeout. To handle this scenario, we have to requeue the request with the given duration. In this case, the given duration is the nearest expected timeout.

func InsertSLAAlert

func InsertSLAAlert(action v1alpha1.Action, w *v1alpha1.Workflow, job metav1.Object) error

func NewController

func NewController(mgr ctrl.Manager, logger logr.Logger) error

func ValidateDAG

func ValidateDAG(list v1alpha1.ActionList) error

ValidateDAG validates the execution workflow. 1. Ensures that action names are qualified (since they are used as generators to jobs) 2. Ensures that there are no two actions with the same name. 3. Ensure that dependencies point to a valid action. 4. Ensure that macros point to a valid action

Types

type BuiltinState

type BuiltinState struct {
	Runtime *lifecycle.Classifier
}

type Controller

type Controller struct {
	ctrl.Manager
	logr.Logger
	// contains filtered or unexported fields
}

func (*Controller) ConnectToGrafana added in v1.0.9

func (r *Controller) ConnectToGrafana(ctx context.Context, cr *v1alpha1.Workflow) error

func (*Controller) Finalize

func (r *Controller) Finalize(obj client.Object) error

func (*Controller) Finalizer

func (r *Controller) Finalizer() string

func (*Controller) Reconcile

func (r *Controller) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*Controller) WatchChaos

func (r *Controller) WatchChaos() predicate.Funcs

func (*Controller) WatchClusters

func (r *Controller) WatchClusters() predicate.Funcs

func (*Controller) WatchServices

func (r *Controller) WatchServices() predicate.Funcs

func (*Controller) WatchTelemetry

func (r *Controller) WatchTelemetry() predicate.Funcs

Jump to

Keyboard shortcuts

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