workflow

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EntrypointTemplateName = "entry"

	HelmReleaseArg                 = "helmrelease"
	TimeoutArg                     = "timeout"
	HelmReleaseExecutorName        = "helmrelease-executor"
	HelmReleaseReverseExecutorName = "helmrelease-reverse-executor"

	ValuesKeyGlobal = "global"
	ChartLabelKey   = "chart"

	DefaultTimeout = "5m"

	ExecutorName     = "executor"
	ExecutorImage    = "azureorkestra/executor"
	ExecutorImageTag = "v0.4.1"

	ChartMuseumName = "chartmuseum"

	Project        = "orkestra"
	OwnershipLabel = "owner"
	HeritageLabel  = "heritage"
)

Variables

View Source
var (
	ErrNoNodesFound      = errors.New("no nodes found in the graph")
	ErrEntryNodeNotFound = errors.New("\"entry\" node not found")
)

Functions

func DeleteWorkflow added in v0.7.0

func DeleteWorkflow(ctx context.Context, wfClient Client) error

DeleteWorkflow removes the workflow from the api server associated with the workflow client

func GetNamespace added in v0.7.0

func GetNamespace() string

func IsFailed added in v0.7.0

func IsFailed(ctx context.Context, wfClient Client) (bool, error)

IsFailed checks if the workflow created by the workflow client is in a failed state

func IsSucceeded added in v0.7.0

func IsSucceeded(ctx context.Context, wfClient Client) (bool, error)

IsSucceeded checks if the workflow created by the workflow client is in a succeeded state

func Run added in v0.7.0

func Run(ctx context.Context, wfClient Client) error

Run calls the generate and Submit commands of the workflow client

func SetFailed added in v0.7.0

func SetFailed(wfClient Client, message string)

SetFailed sets one of the workflow conditions in the failed state

func SetProgressing added in v0.7.0

func SetProgressing(wfClient Client)

SetProgressing sets one of the workflow conditions in the progressing state

func SetSucceeded added in v0.7.0

func SetSucceeded(wfClient Client)

SetSucceeded sets one of the workflow conditions in the succeeded state

func SetSuspended added in v0.7.0

func SetSuspended(wfClient Client)

SetSuspended sets one of the workflow conditions in the suspended state

func Suspend added in v0.7.0

func Suspend(ctx context.Context, wfClient Client) error

Suspend sets the suspend flag on the workflow associated with the workflow client if the workflow still exists on the cluster

func UpdateStatus added in v0.7.0

func UpdateStatus(ctx context.Context, wfClient Client) error

UpdateStatus updates the status of the owning appGroup with the workflow condition type of the workflow client

Types

type Builder added in v0.7.0

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder added in v0.7.0

func NewBuilder(client client.Client, logger logr.Logger) *Builder

func NewBuilderFromClient added in v0.7.0

func NewBuilderFromClient(client Client) *Builder

func (*Builder) Build added in v0.7.0

func (builder *Builder) Build() Client

func (*Builder) Forward added in v0.7.0

func (builder *Builder) Forward(appGroup *v1alpha1.ApplicationGroup) *Builder

func (*Builder) InNamespace added in v0.7.0

func (builder *Builder) InNamespace(namespace string) *Builder

func (*Builder) Reverse added in v0.7.0

func (builder *Builder) Reverse(appGroup *v1alpha1.ApplicationGroup) *Builder

func (*Builder) Rollback added in v0.7.0

func (builder *Builder) Rollback(appGroup *v1alpha1.ApplicationGroup) *Builder

func (*Builder) WithExecutor added in v0.7.0

func (builder *Builder) WithExecutor(executor ExecutorFunc) *Builder

func (*Builder) WithParallelism added in v0.7.0

func (builder *Builder) WithParallelism(numNodes int64) *Builder

func (*Builder) WithStagingRepo added in v0.7.0

func (builder *Builder) WithStagingRepo(stagingURL string) *Builder

type Client added in v0.7.0

type Client interface {
	// Generate the object required by the workflow engine
	Generate(ctx context.Context) error

	// Submit the object required by the workflow engine generated by the Generate method
	Submit(ctx context.Context) error

	// GetType returns the workflow client type
	GetType() v1alpha1.WorkflowType

	// GetLogger returns the logger associated with the workflow client
	GetLogger() logr.Logger

	// GetNamespace returns the namespace that the workflow should run in
	GetNamespace() string

	// GetOptions returns the client options used with the workflow client
	GetOptions() ClientOptions

	// GetWorkflow returns the workflow from the k8s apiserver associated with the workflow client
	GetWorkflow(context.Context) (*v1alpha13.Workflow, error)

	// GetClient returns the k8s client associated with the workflow
	GetClient() client.Client

	// GetAppGroup returns the app group from the workflow client
	GetAppGroup() *v1alpha1.ApplicationGroup
}

type ClientOptions added in v0.7.0

type ClientOptions struct {
	// contains filtered or unexported fields
}

type ClientType added in v0.7.0

type ClientType string

type ExecutorAction added in v0.6.0

type ExecutorAction string

ExecutorAction defines the set of executor actions which can be performed on a helmrelease object

const (
	Install ExecutorAction = "install"
	Delete  ExecutorAction = "delete"
)

type ExecutorFunc added in v0.7.0

type ExecutorFunc func(string, ExecutorAction) v1alpha13.Template

type ForwardWorkflowClient added in v0.7.0

type ForwardWorkflowClient struct {
	client.Client
	logr.Logger
	ClientOptions
	// contains filtered or unexported fields
}

func (*ForwardWorkflowClient) Generate added in v0.7.0

func (wc *ForwardWorkflowClient) Generate(ctx context.Context) error

func (*ForwardWorkflowClient) GetAppGroup added in v0.7.0

func (wc *ForwardWorkflowClient) GetAppGroup() *v1alpha1.ApplicationGroup

func (*ForwardWorkflowClient) GetClient added in v0.7.0

func (wc *ForwardWorkflowClient) GetClient() client.Client

func (*ForwardWorkflowClient) GetLogger added in v0.7.0

func (wc *ForwardWorkflowClient) GetLogger() logr.Logger

func (*ForwardWorkflowClient) GetNamespace added in v0.7.0

func (wc *ForwardWorkflowClient) GetNamespace() string

func (*ForwardWorkflowClient) GetOptions added in v0.7.0

func (wc *ForwardWorkflowClient) GetOptions() ClientOptions

func (*ForwardWorkflowClient) GetType added in v0.7.0

func (*ForwardWorkflowClient) GetWorkflow added in v0.7.0

func (wc *ForwardWorkflowClient) GetWorkflow(ctx context.Context) (*v1alpha13.Workflow, error)

func (*ForwardWorkflowClient) Submit added in v0.7.0

func (wc *ForwardWorkflowClient) Submit(ctx context.Context) error

type Graph added in v0.3.0

type Graph struct {
	// contains filtered or unexported fields
}

func Build added in v0.3.0

func Build(entry string, nodes map[string]v1alpha13.NodeStatus) (*Graph, error)

func (*Graph) Reverse added in v0.3.0

func (g *Graph) Reverse() [][]fluxhelmv2beta1.HelmRelease

type Node added in v0.3.0

type Node struct {
	Status v1alpha13.NodeStatus
	Level  int
}

type ReverseWorkflowClient added in v0.7.0

type ReverseWorkflowClient struct {
	client.Client
	logr.Logger
	ClientOptions
	// contains filtered or unexported fields
}

func (*ReverseWorkflowClient) Generate added in v0.7.0

func (wc *ReverseWorkflowClient) Generate(ctx context.Context) error

func (*ReverseWorkflowClient) GetAppGroup added in v0.7.0

func (wc *ReverseWorkflowClient) GetAppGroup() *v1alpha1.ApplicationGroup

func (*ReverseWorkflowClient) GetClient added in v0.7.0

func (wc *ReverseWorkflowClient) GetClient() client.Client

func (*ReverseWorkflowClient) GetLogger added in v0.7.0

func (wc *ReverseWorkflowClient) GetLogger() logr.Logger

func (*ReverseWorkflowClient) GetNamespace added in v0.7.0

func (wc *ReverseWorkflowClient) GetNamespace() string

func (*ReverseWorkflowClient) GetOptions added in v0.7.0

func (wc *ReverseWorkflowClient) GetOptions() ClientOptions

func (*ReverseWorkflowClient) GetType added in v0.7.0

func (*ReverseWorkflowClient) GetWorkflow added in v0.7.0

func (wc *ReverseWorkflowClient) GetWorkflow(ctx context.Context) (*v1alpha13.Workflow, error)

func (*ReverseWorkflowClient) Submit added in v0.7.0

func (wc *ReverseWorkflowClient) Submit(ctx context.Context) error

type RollbackWorkflowClient added in v0.7.0

type RollbackWorkflowClient struct {
	client.Client
	logr.Logger
	ClientOptions
	// contains filtered or unexported fields
}

func (*RollbackWorkflowClient) Generate added in v0.7.0

func (wc *RollbackWorkflowClient) Generate(ctx context.Context) error

func (*RollbackWorkflowClient) GetAppGroup added in v0.7.0

func (*RollbackWorkflowClient) GetClient added in v0.7.0

func (wc *RollbackWorkflowClient) GetClient() client.Client

func (*RollbackWorkflowClient) GetLogger added in v0.7.0

func (wc *RollbackWorkflowClient) GetLogger() logr.Logger

func (*RollbackWorkflowClient) GetNamespace added in v0.7.0

func (wc *RollbackWorkflowClient) GetNamespace() string

func (*RollbackWorkflowClient) GetOptions added in v0.7.0

func (wc *RollbackWorkflowClient) GetOptions() ClientOptions

func (*RollbackWorkflowClient) GetType added in v0.7.0

func (*RollbackWorkflowClient) GetWorkflow added in v0.7.0

func (wc *RollbackWorkflowClient) GetWorkflow(ctx context.Context) (*v1alpha13.Workflow, error)

func (*RollbackWorkflowClient) Submit added in v0.7.0

func (wc *RollbackWorkflowClient) Submit(ctx context.Context) error

Jump to

Keyboard shortcuts

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