v1

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package v1 is the version 1 of the Workflow ApI +k8s:deepcopy-gen=package

Index

Constants

View Source
const (
	// ResourcePlural is the id to indentify pluarals
	ResourcePlural = "workflows"
	// ResourceSingular represents the id for identify singular resource
	ResourceSingular = "workflow"
	// ResourceKind
	ResourceKind = "Workflow"
	// ReourceVersion
	ResourceVersion = "v1"
)

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: workflow.GroupName, Version: ResourceVersion}

SchemeGroupVersion is the group version used to register these objects.

Functions

func GetGeneratedDeepCopyFuncs deprecated

func GetGeneratedDeepCopyFuncs() []conversion.GeneratedDeepCopyFunc

GetGeneratedDeepCopyFuncs returns the generated funcs, since we aren't registering them.

Deprecated: deepcopy registration will go away when static deepcopy is fully implemented.

func IsWorkflowDefaulted

func IsWorkflowDefaulted(w *Workflow) bool

IsWorkflowDefaulted check wether

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func RemoveStepFromSpec

func RemoveStepFromSpec(w *Workflow, stepName string) error

RemoveStepFromSpec removes Step from Workflow Spec

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

func ValidateExternalReference

func ValidateExternalReference(externalReference *api.ObjectReference, fieldPath *field.Path) field.ErrorList

ValidateExternalReference validates external object reference

func ValidateJobTemplateSpec

func ValidateJobTemplateSpec(spec *batchv2.JobTemplateSpec, fldPath *field.Path) field.ErrorList

func ValidateWorkflow

func ValidateWorkflow(workflow *Workflow) field.ErrorList

ValidateWorkflow validates Workflow

func ValidateWorkflowSpec

func ValidateWorkflowSpec(spec *WorkflowSpec, fieldPath *field.Path) field.ErrorList

ValidateWorkflowSpec validates WorkflowSpec

func ValidateWorkflowSpecUpdate

func ValidateWorkflowSpecUpdate(spec, oldSpec *WorkflowSpec, running, completed map[string]bool, fieldPath *field.Path) field.ErrorList

func ValidateWorkflowStatus

func ValidateWorkflowStatus(status *WorkflowStatus, fieldPath *field.Path) field.ErrorList

ValidateWorkflowStatus validates status

func ValidateWorkflowStatusUpdate

func ValidateWorkflowStatusUpdate(status, oldStatus WorkflowStatus) field.ErrorList

ValidateWorkflowStatusUpdate validates WorkflowStatus during update

func ValidateWorkflowSteps

func ValidateWorkflowSteps(steps []WorkflowStep, fieldPath *field.Path) field.ErrorList

ValidateWorkflowSteps validates steps. It detects cycles (with topological sort) and checks whether JobSpec are correct

func ValidateWorkflowUpdate

func ValidateWorkflowUpdate(workflow, oldWorkflow *Workflow) field.ErrorList

ValidateWorkflowUpdate validates Workflow during update

func ValidateWorkflowUpdateStatus

func ValidateWorkflowUpdateStatus(workflow, oldWorkflow *Workflow) field.ErrorList

Types

type Workflow

type Workflow struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object's metadata.
	// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec represents the desired behaviour of the Workflow.
	Spec WorkflowSpec `json:"spec,omitempty"`

	// Status contains the current status off the Workflow
	Status WorkflowStatus `json:"status,omitempty"`
}

Workflow represents a DAG workflow +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func DefaultWorkflow

func DefaultWorkflow(undefaultedWorkflow *Workflow) *Workflow

DefaultWorkflow defaults workflow

func (*Workflow) DeepCopy

func (in *Workflow) DeepCopy() *Workflow

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workflow.

func (*Workflow) DeepCopyInto

func (in *Workflow) DeepCopyInto(out *Workflow)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Workflow) DeepCopyObject

func (in *Workflow) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type WorkflowCondition

type WorkflowCondition struct {
	// Type of workflow condition
	Type WorkflowConditionType `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status api.ConditionStatus `json:"status"`
	// Last time the condition was checked.
	LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"`
	// Last time the condition transited from one status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	// (brief) reason for the condition's last transition.
	Reason string `json:"reason,omitempty"`
	// Human readable message indicating details about last transition.
	Message string `json:"message,omitempty"`
}

WorkflowCondition represent the condition of the Workflow

func (*WorkflowCondition) DeepCopy

func (in *WorkflowCondition) DeepCopy() *WorkflowCondition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowCondition.

func (*WorkflowCondition) DeepCopyInto

func (in *WorkflowCondition) DeepCopyInto(out *WorkflowCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WorkflowConditionType

type WorkflowConditionType string

WorkflowConditionType is the type of WorkflowCondition

const (
	// WorkflowComplete means the workflow has completed its execution.
	WorkflowComplete WorkflowConditionType = "Complete"
	// WorkflowFailed means the workflow has failed its execution.
	WorkflowFailed WorkflowConditionType = "Failed"
)

These are valid conditions of a workflow.

type WorkflowList

type WorkflowList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard list metadata
	// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is the list of Workflow
	Items []Workflow `json:"items"`
}

WorkflowList implements list of Workflow. +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*WorkflowList) DeepCopy

func (in *WorkflowList) DeepCopy() *WorkflowList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowList.

func (*WorkflowList) DeepCopyInto

func (in *WorkflowList) DeepCopyInto(out *WorkflowList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WorkflowList) DeepCopyObject

func (in *WorkflowList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type WorkflowSpec

type WorkflowSpec struct {
	ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`

	Steps []WorkflowStep `json:"steps,omitempty"`

	// Selector for created jobs (if any)
	Selector *metav1.LabelSelector `json:"selector,omitempty"`
}

WorkflowSpec contains Workflow specification

func (*WorkflowSpec) DeepCopy

func (in *WorkflowSpec) DeepCopy() *WorkflowSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowSpec.

func (*WorkflowSpec) DeepCopyInto

func (in *WorkflowSpec) DeepCopyInto(out *WorkflowSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WorkflowStatus

type WorkflowStatus struct {
	// Conditions represent the latest available observations of an object's current state.
	Conditions []WorkflowCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`

	// StartTime represents time when the workflow was acknowledged by the Workflow controller
	// It is not guaranteed to be set in happens-before order across separate operations.
	// It is represented in RFC3339 form and is in UTC.
	// StartTime doesn't consider startime of `ExternalReference`
	StartTime *metav1.Time `json:"startTime,omitempty"`

	// CompletionTime represents time when the workflow was completed. It is not guaranteed to
	// be set in happens-before order across separate operations.
	// It is represented in RFC3339 form and is in UTC.
	CompletionTime *metav1.Time `json:"completionTime,omitempty"`

	// Statuses represent status of different steps
	Statuses []WorkflowStepStatus `json:"statuses"`
}

WorkflowStatus represents the status of Workflow

func (*WorkflowStatus) DeepCopy

func (in *WorkflowStatus) DeepCopy() *WorkflowStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStatus.

func (*WorkflowStatus) DeepCopyInto

func (in *WorkflowStatus) DeepCopyInto(out *WorkflowStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WorkflowStep

type WorkflowStep struct {
	// Name of the step
	Name string `json:"name,omitempty"`

	// JobTemplate contains the job specificaton that should be run in this Workflow.
	// Only one between externalRef and JobTemplate can be set.
	JobTemplate *batch.JobTemplateSpec `json:"jobTemplate,omitempty"`

	// External contains a reference to another schedulable resource.
	// Only one between ExternalRef and JobTemplate can be set.
	ExternalRef *api.ObjectReference `json:"externalRef,omitempty"`

	// Dependecies represent dependecies of the current workflow step
	Dependencies []string `json:"dependencies,omitempty"`
}

WorkflowStep contains necessary information to identifiy the node of the workflow graph

func GetStepByName

func GetStepByName(w *Workflow, stepName string) *WorkflowStep

GetStepByName returns a pointer to Workflow Step

func (*WorkflowStep) DeepCopy

func (in *WorkflowStep) DeepCopy() *WorkflowStep

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStep.

func (*WorkflowStep) DeepCopyInto

func (in *WorkflowStep) DeepCopyInto(out *WorkflowStep)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WorkflowStepStatus

type WorkflowStepStatus struct {
	// Name represents the Name of the Step
	Name string `json:"name,omitempty"`
	// Complete reports the completion of status`
	Complete bool `json:"complete"`
	// Reference contains a reference to the WorkflowStep
	Reference api.ObjectReference `json:"reference"`
}

WorkflowStepStatus contains necessary information for the step status

func GetStepStatusByName

func GetStepStatusByName(w *Workflow, stepName string) *WorkflowStepStatus

GetStepStatusByName returns a pointer to Workflow Step

func (*WorkflowStepStatus) DeepCopy

func (in *WorkflowStepStatus) DeepCopy() *WorkflowStepStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStepStatus.

func (*WorkflowStepStatus) DeepCopyInto

func (in *WorkflowStepStatus) DeepCopyInto(out *WorkflowStepStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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