app

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerRunner added in v0.3.0

type ContainerRunner interface {
	// Prepare should create (not run) any containers/pods, setup the environment, mounts, etc
	Prepare(ctx context.Context, imageName string) (id string, err error)
	// Run should execution the action and wait for completion
	Run(ctx context.Context, id string) error
	// Destroy should handle removing all things created/setup in Prepare
	Destroy(ctx context.Context) error
	// SetActionData gets the action data into the implementation
	SetActionData(ctx context.Context, workflowID string, action *workflow.WorkflowAction)
}

ContainerRunner defines the methods needed to run a workflow task action

type Controller added in v0.3.0

type Controller struct {
	WorkflowClient workflow.WorkflowServiceClient
	HardwareClient hardware.HardwareServiceClient
	Backend        Runner
}

Controller

func (Controller) GetHardwareID added in v0.3.3

func (c Controller) GetHardwareID(ctx context.Context, log logr.Logger, identifier string) string

func (Controller) Start added in v0.3.0

func (c Controller) Start(ctx context.Context, log logr.Logger, id string)

Start the control loop and waits for a context cancel/done to return

type EnvironmentRunner added in v0.3.0

type EnvironmentRunner interface {
	// PrepareEnv should do things like create namespaces, configs, secrets, etc
	PrepareEnv(ctx context.Context, id string) error
	// CleanEnv should remove anything that was created when PrepareEnv was called
	CleanEnv(ctx context.Context) error
}

EnvironmentRunner is for preparing an environment for running workflow task actions

type Runner added in v0.3.0

type Runner interface {
	EnvironmentRunner
	ContainerRunner
}

Runner interface what backend implementations must define

Jump to

Keyboard shortcuts

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