Documentation ¶
Index ¶
- Constants
- func CascadeDeleteOptions(gracePeriodSeconds int64) *metav1.DeleteOptions
- func GetStepByName(w *wapi.Workflow, stepName string) *wapi.WorkflowStep
- func GetStepStatusByName(w *wapi.Workflow, stepName string) *wapi.WorkflowStepStatus
- func InferDaemonSetJobLabelSelectorForJobs(daemonsetjob *dapi.DaemonSetJob) labels.Selector
- func IsDaemonSetJobFinished(d *dapi.DaemonSetJob) bool
- func IsJobFinished(j *batch.Job) bool
- func IsWorkflowFinished(w *wapi.Workflow) bool
- func NewWorkflowControl(client wclientset.Interface) *realWorkflowControl
- func RemoveStepFromSpec(w *wapi.Workflow, stepName string) error
- type CronWorkflowController
- type CronWorkflowControllerConfig
- type DaemonSetJobController
- type DaemonSetJobControllerConfig
- type FakeJobControl
- func (f *FakeJobControl) CreateJobFromDaemonSetJob(namespace string, template *batchv2.JobTemplateSpec, ...) (*batch.Job, error)
- func (f *FakeJobControl) CreateJobFromWorkflow(namespace string, template *batchv2.JobTemplateSpec, workflow *wapi.Workflow, ...) (*batch.Job, error)
- func (f *FakeJobControl) DeleteJob(namespace, name string, object runtime.Object) error
- type JobControlInterface
- type WorkflowController
- type WorkflowControllerConfig
- type WorkflowJobControl
- func (w WorkflowJobControl) CreateJob(namespace string, subName string, obj *metav1.ObjectMeta, ...) (*batch.Job, error)
- func (w WorkflowJobControl) CreateJobFromDaemonSetJob(namespace string, template *batchv2.JobTemplateSpec, ...) (*batch.Job, error)
- func (w WorkflowJobControl) CreateJobFromWorkflow(namespace string, template *batchv2.JobTemplateSpec, workflow *wapi.Workflow, ...) (*batch.Job, error)
- func (w WorkflowJobControl) DeleteJob(namespace, jobName string, object runtime.Object) error
Constants ¶
const ( DaemonSetJobLabelKey = "kubernetes.io/DaemonSetJob" DaemonSetJobMD5AnnotationKey = "workflow.k8s.io/jobspec-md5" )
DaemonSetJobLabelKey defines the key of label to be injected by DaemonSetJob controller
const ( WorkflowLabelKey = "kubernetes.io/workflow" WorkflowStepLabelKey = "kubernetes.io/workflow-step" )
WorkflowStepLabelKey defines the key of label to be injected by workflow controller
const (
CronWorkflowLabelKey = "kubernetes.io/cronworkflow"
)
Variables ¶
This section is empty.
Functions ¶
func CascadeDeleteOptions ¶
func CascadeDeleteOptions(gracePeriodSeconds int64) *metav1.DeleteOptions
CascadeDeleteOptions returns a DeleteOptions with Cascaded set
func GetStepByName ¶
func GetStepByName(w *wapi.Workflow, stepName string) *wapi.WorkflowStep
GetStepByName returns a pointer to WorkflowStep
func GetStepStatusByName ¶
func GetStepStatusByName(w *wapi.Workflow, stepName string) *wapi.WorkflowStepStatus
GetStepStatusByName return a pointer to WorkflowStepStatus
func InferDaemonSetJobLabelSelectorForJobs ¶
func InferDaemonSetJobLabelSelectorForJobs(daemonsetjob *dapi.DaemonSetJob) labels.Selector
InferDaemonSetJobLabelSelectorForJobs returns labels.Selector corresponding to the associated Jobs
func IsDaemonSetJobFinished ¶
func IsDaemonSetJobFinished(d *dapi.DaemonSetJob) bool
IsDaemonSetJobFinished checks wether a daemonsetjob is finished. A daemonsetjob is finished if one of its condition is Complete or Failed.
func IsJobFinished ¶
IsJobFinished checks whether a Job is finished
func IsWorkflowFinished ¶
IsWorkflowFinished checks wether a workflow is finished. A workflow is finished if one of its condition is Complete or Failed.
func NewWorkflowControl ¶
func NewWorkflowControl(client wclientset.Interface) *realWorkflowControl
NewWorkflowControl creates a realWorkflowControl
Types ¶
type CronWorkflowController ¶
type CronWorkflowController struct { Client wclientset.Interface KubeClient clientset.Interface Recorder record.EventRecorder // contains filtered or unexported fields }
CronWorkflowController represents the Workflow controller
func NewCronWorkflowController ¶
func NewCronWorkflowController(client wclientset.Interface, kubeClient clientset.Interface) *CronWorkflowController
NewCronWorkflowController creates and initializes the CronWorkflowController instance
func (*CronWorkflowController) AddHealthCheck ¶
func (w *CronWorkflowController) AddHealthCheck(h healthcheck.Handler) error
AddHealthCheck add Readiness and Liveness Checks to the handler
type CronWorkflowControllerConfig ¶
CronWorkflowControllerConfig contains info to customize Workflow controller behaviour
type DaemonSetJobController ¶
type DaemonSetJobController struct { Client dclientset.Interface KubeClient clientset.Interface DaemonSetJobLister dlisters.DaemonSetJobLister DaemonSetJobSynced cache.InformerSynced JobLister batchv1listers.JobLister JobSynced cache.InformerSynced // returns true if job has been synced. Added as member for testing JobControl JobControlInterface NodeLister corev1Listers.NodeLister NodeSynced cache.InformerSynced Recorder record.EventRecorder // contains filtered or unexported fields }
DaemonSetJobController represents the DaemonSetJob controller
func NewDaemonSetJobController ¶
func NewDaemonSetJobController( client dclientset.Interface, kubeClient clientset.Interface, kubeInformerFactory kubeinformers.SharedInformerFactory, deamonsetJobInformerFactory dinformers.SharedInformerFactory) *DaemonSetJobController
NewDaemonSetJobController creates and initializes the DaemonSetJobController instance
func (*DaemonSetJobController) AddHealthCheck ¶
func (d *DaemonSetJobController) AddHealthCheck(h healthcheck.Handler)
AddHealthCheck add Readiness and Liveness Checks to the handler
type DaemonSetJobControllerConfig ¶
DaemonSetJobControllerConfig contains info to customize DaemonSetJob controller behaviour
type FakeJobControl ¶
type FakeJobControl struct { }
FakeJobControl implements WorkflowJobControl interface for testing purpose
func (*FakeJobControl) CreateJobFromDaemonSetJob ¶
func (f *FakeJobControl) CreateJobFromDaemonSetJob(namespace string, template *batchv2.JobTemplateSpec, workflow *dapi.DaemonSetJob, nodeName string) (*batch.Job, error)
CreateJobFromDaemonSetJob mocks job creation
func (*FakeJobControl) CreateJobFromWorkflow ¶
func (f *FakeJobControl) CreateJobFromWorkflow(namespace string, template *batchv2.JobTemplateSpec, workflow *wapi.Workflow, key string) (*batch.Job, error)
CreateJobFromWorkflow mocks job creation
type JobControlInterface ¶
type JobControlInterface interface { // CreateJobFromWorkflow CreateJobFromWorkflow(namespace string, template *batchv2.JobTemplateSpec, workflow *wapi.Workflow, key string) (*batch.Job, error) // CreateJobFromDaemonSetJob CreateJobFromDaemonSetJob(namespace string, template *batchv2.JobTemplateSpec, daemonsetjob *dapi.DaemonSetJob, nodeName string) (*batch.Job, error) // DeleteJob DeleteJob(namespace, name string, object runtime.Object) error }
JobControlInterface defines interface to control Jobs life-cycle. Interface is needed to mock it in unit tests
type WorkflowController ¶
type WorkflowController struct { Client wclientset.Interface KubeClient clientset.Interface WorkflowLister wlisters.WorkflowLister WorkflowSynced cache.InformerSynced JobLister batchv1listers.JobLister JobSynced cache.InformerSynced // returns true if job has been synced. Added as member for testing JobControl JobControlInterface Recorder record.EventRecorder // contains filtered or unexported fields }
WorkflowController represents the Workflow controller
func NewWorkflowController ¶
func NewWorkflowController( client wclientset.Interface, kubeClient clientset.Interface, kubeInformerFactory kubeinformers.SharedInformerFactory, workflowInformerFactory winformers.SharedInformerFactory) *WorkflowController
NewWorkflowController creates and initializes the WorkflowController instance
func (*WorkflowController) AddHealthCheck ¶
func (w *WorkflowController) AddHealthCheck(h healthcheck.Handler)
AddHealthCheck add Readiness and Liveness Checks to the handler
type WorkflowControllerConfig ¶
WorkflowControllerConfig contains info to customize Workflow controller behaviour
type WorkflowJobControl ¶
type WorkflowJobControl struct { KubeClient clientset.Interface Recorder record.EventRecorder }
WorkflowJobControl implements JobControlInterface
func (WorkflowJobControl) CreateJob ¶
func (w WorkflowJobControl) CreateJob(namespace string, subName string, obj *metav1.ObjectMeta, template *batchv2.JobTemplateSpec, labelsset *labels.Set, owner *metav1.OwnerReference) (*batch.Job, error)
CreateJob creates a Job According to a specific JobTemplateSpec
func (WorkflowJobControl) CreateJobFromDaemonSetJob ¶
func (w WorkflowJobControl) CreateJobFromDaemonSetJob(namespace string, template *batchv2.JobTemplateSpec, daemonsetjob *dapi.DaemonSetJob, nodeName string) (*batch.Job, error)
CreateJobFromDaemonSetJob creates a Job According to a specific JobTemplateSpec
func (WorkflowJobControl) CreateJobFromWorkflow ¶
func (w WorkflowJobControl) CreateJobFromWorkflow(namespace string, template *batchv2.JobTemplateSpec, workflow *wapi.Workflow, stepName string) (*batch.Job, error)
CreateJobFromWorkflow creates a Job According to a specific JobTemplateSpec