Documentation
¶
Index ¶
- Variables
- func CheckAssertions(action *v1alpha1.Action, state lifecycle.ClassifierReader) error
- func CheckDependencies(action *v1alpha1.Action, callIndex index) error
- func CheckJobRef(action *v1alpha1.Action, callIndex index) error
- func GetNextLogicalJob(timebase metav1.Time, all []v1alpha1.Action, gs lifecycle.ClassifierReader, ...) ([]v1alpha1.Action, time.Time)
- func NewController(ctx context.Context, mgr ctrl.Manager, logger logr.Logger) error
- func PrepareDependencyGraph(actionList []v1alpha1.Action) (index, error)
- func RandomFixedIndexes(start, end, count uint) []uint
- type Controller
- func (r *Controller) CheckTemplateRef(ctx context.Context, who metav1.Object, action *v1alpha1.Action) error
- func (r *Controller) ConnectToGrafana(ctx context.Context, t *v1alpha1.Scenario) error
- func (r *Controller) CreateWebhookServer(ctx context.Context) error
- func (r *Controller) Finalize(obj client.Object) error
- func (r *Controller) Finalizer() string
- func (r *Controller) GetClusterView(ctx context.Context, req types.NamespacedName) error
- func (r *Controller) HasFailed(ctx context.Context, t *v1alpha1.Scenario) error
- func (r *Controller) ImportTelemetryDashboards(ctx context.Context, scenario *v1alpha1.Scenario) ([]string, error)
- func (r *Controller) Initialize(ctx context.Context, t *v1alpha1.Scenario) error
- func (r *Controller) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *Controller) RunActions(ctx context.Context, t *v1alpha1.Scenario, actionList []v1alpha1.Action) error
- func (r *Controller) StartTelemetry(ctx context.Context, t *v1alpha1.Scenario) error
- func (r *Controller) Validate(ctx context.Context, scenario *v1alpha1.Scenario, ...) error
- type SList
Constants ¶
This section is empty.
Variables ¶
var ( PrometheusPort = int64(9090) GrafanaPort = int64(3000) LogviewerPort = int64(80) )
var WebhookURL string
Functions ¶
func CheckAssertions ¶
func CheckAssertions(action *v1alpha1.Action, state lifecycle.ClassifierReader) error
func CheckDependencies ¶
func CheckJobRef ¶
func GetNextLogicalJob ¶
func GetNextLogicalJob(timebase metav1.Time, all []v1alpha1.Action, gs lifecycle.ClassifierReader, executed map[string]v1alpha1.ConditionalExpr) ([]v1alpha1.Action, 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 call 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 NewController ¶
func PrepareDependencyGraph ¶
func RandomFixedIndexes ¶
RandomFixedIndexes returns the `count` random indexes between `start` and `end`. [start, end).
Types ¶
type Controller ¶
func (*Controller) CheckTemplateRef ¶
func (*Controller) ConnectToGrafana ¶
func (*Controller) CreateWebhookServer ¶
func (r *Controller) CreateWebhookServer(ctx context.Context) error
CreateWebhookServer creates a Webhook for listening for events from Grafana *
func (*Controller) Finalizer ¶
func (r *Controller) Finalizer() string
func (*Controller) GetClusterView ¶
func (r *Controller) GetClusterView(ctx context.Context, req types.NamespacedName) error
GetClusterView list all child objects in this namespace that belong to this scenario, and split them into active, successful, and failed jobs.
func (*Controller) ImportTelemetryDashboards ¶
func (r *Controller) ImportTelemetryDashboards(ctx context.Context, scenario *v1alpha1.Scenario) ([]string, error)
ImportTelemetryDashboards iterates the referenced services (directly via Service or indirectly via Cluster) and list all telemetry dashboards that need to be imported
func (*Controller) Initialize ¶
func (*Controller) RunActions ¶
func (*Controller) StartTelemetry ¶
func (*Controller) Validate ¶
func (r *Controller) Validate(ctx context.Context, scenario *v1alpha1.Scenario, clusterView lifecycle.ClassifierReader) error
Validate 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.