context

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigMapKeyComponents is the key in ConfigMap Data field for containing data of components
	ConfigMapKeyComponents = "components"
	// ConfigMapKeyVars is the key in ConfigMap Data field for containing data of variable
	ConfigMapKeyVars = "vars"
	// AnnotationStartTimestamp is the annotation key of the workflow start  timestamp
	AnnotationStartTimestamp = "vela.io/startTime"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentManifest

type ComponentManifest struct {
	Workload    model.Instance
	Auxiliaries []model.Instance
}

ComponentManifest contains resources rendered from an application component.

func (*ComponentManifest) Patch

func (comp *ComponentManifest) Patch(patchValue *value.Value) error

Patch the ComponentManifest with value

type Context

type Context interface {
	GetComponent(name string) (*ComponentManifest, error)
	GetComponents() map[string]*ComponentManifest
	PatchComponent(name string, patchValue *value.Value) error
	GetVar(paths ...string) (*value.Value, error)
	SetVar(v *value.Value, paths ...string) error
	Commit() error
	MakeParameter(parameter interface{}) (*value.Value, error)
	StoreRef() *corev1.ObjectReference
}

Context is workflow context interface

func LoadContext

func LoadContext(cli client.Client, ns, app string) (Context, error)

LoadContext load workflow context from store.

func NewContext

func NewContext(cli client.Client, ns, rev string) (Context, error)

NewContext new workflow context.

func NewEmptyContext added in v1.1.1

func NewEmptyContext(cli client.Client, ns, app string) (Context, error)

NewEmptyContext new workflow context without initialize data.

type WorkflowContext

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

WorkflowContext is workflow context.

func (*WorkflowContext) Commit

func (wf *WorkflowContext) Commit() error

Commit the workflow context and persist it's content.

func (*WorkflowContext) GetComponent

func (wf *WorkflowContext) GetComponent(name string) (*ComponentManifest, error)

GetComponent Get ComponentManifest from workflow context.

func (*WorkflowContext) GetComponents

func (wf *WorkflowContext) GetComponents() map[string]*ComponentManifest

GetComponents Get All ComponentManifest from workflow context.

func (*WorkflowContext) GetVar

func (wf *WorkflowContext) GetVar(paths ...string) (*value.Value, error)

GetVar get variable from workflow context.

func (*WorkflowContext) LoadFromConfigMap

func (wf *WorkflowContext) LoadFromConfigMap(cm corev1.ConfigMap) error

LoadFromConfigMap recover workflow context from configMap.

func (*WorkflowContext) MakeParameter

func (wf *WorkflowContext) MakeParameter(parameter interface{}) (*value.Value, error)

MakeParameter make 'value' with interface{}

func (*WorkflowContext) PatchComponent

func (wf *WorkflowContext) PatchComponent(name string, patchValue *value.Value) error

PatchComponent patch component with value.

func (*WorkflowContext) SetVar

func (wf *WorkflowContext) SetVar(v *value.Value, paths ...string) error

SetVar set variable to workflow context.

func (*WorkflowContext) StoreRef

func (wf *WorkflowContext) StoreRef() *corev1.ObjectReference

StoreRef return the store reference of workflow context.

Jump to

Keyboard shortcuts

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