util

package
v2.5.0-rc5+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplySubmitOpts

func ApplySubmitOpts(wf *wfv1.Workflow, opts *SubmitOpts) error

Apply the Submit options into workflow object

func ConvertYAMLToJSON

func ConvertYAMLToJSON(str string) (string, error)

func CreateServerDryRun

func CreateServerDryRun(wf *wfv1.Workflow, wfClientset wfclientset.Interface) (*wfv1.Workflow, error)

CreateServerDryRun fills the workflow struct with the server's representation without creating it and returns an error, if there is any

func FormulateResubmitWorkflow

func FormulateResubmitWorkflow(wf *wfv1.Workflow, memoized bool) (*wfv1.Workflow, error)

FormulateResubmitWorkflow formulate a new workflow from a previous workflow, optionally re-using successful nodes

func FromUnstructured

func FromUnstructured(un *unstructured.Unstructured) (*wfv1.Workflow, error)

FromUnstructured converts an unstructured object to a workflow

func InstanceIDRequirement

func InstanceIDRequirement(instanceID string) labels.Requirement

InstanceIDRequirement returns the label requirement to filter against a controller instance (or not)

func IsJSONStr

func IsJSONStr(str string) bool

func IsWorkflowCompleted

func IsWorkflowCompleted(wf *wfv1.Workflow) bool

IsWorkflowCompleted returns whether or not a workflow is considered completed

func IsWorkflowSuspended

func IsWorkflowSuspended(wf *wfv1.Workflow) bool

IsWorkflowSuspended returns whether or not a workflow is considered suspended

func IsWorkflowTerminated

func IsWorkflowTerminated(wf *wfv1.Workflow) bool

IsWorkflowTerminated returns whether or not a workflow is considered terminated

func NewWorkflowInformer

func NewWorkflowInformer(cfg *rest.Config, ns string, resyncPeriod time.Duration, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer

NewWorkflowInformer returns the workflow informer used by the controller. This is actually a custom built UnstructuredInformer which is in actuality returning unstructured.Unstructured objects. We no longer return WorkflowInformer due to: https://github.com/kubernetes/kubernetes/issues/57705 https://github.com/argoproj/argo/issues/632

func PodSpecPatchMerge

func PodSpecPatchMerge(wf *wfv1.Workflow, tmpl *wfv1.Template) (string, error)

PodSpecPatchMerge will do strategic merge the workflow level PodSpecPatch and template level PodSpecPatch

func ReadFromFilePathsOrUrls

func ReadFromFilePathsOrUrls(filePathsOrUrls ...string) ([][]byte, error)

ReadFromFilePathsOrUrls reads the content of a single or a list of file paths and/or urls

func ReadFromStdin

func ReadFromStdin() ([]byte, error)

Reads from stdin

func ReadFromUrl

func ReadFromUrl(url string) ([]byte, error)

Reads the content of a url

func ReadManifest

func ReadManifest(manifestPaths ...string) ([][]byte, error)

ReadManifest reads from stdin, a single file/url, or a list of files and/or urls

func ResumeWorkflow

func ResumeWorkflow(wfIf v1alpha1.WorkflowInterface, workflowName string) error

ResumeWorkflow resumes a workflow by setting spec.suspend to nil and any suspended nodes to Successful. Retries conflict errors

func RetryWorkflow

func RetryWorkflow(kubeClient kubernetes.Interface, wfClient v1alpha1.WorkflowInterface, wf *wfv1.Workflow) (*wfv1.Workflow, error)

RetryWorkflow updates a workflow, deleting all failed steps as well as the onExit node (and children)

func SubmitWorkflow

func SubmitWorkflow(wfIf v1alpha1.WorkflowInterface, wfClientset wfclientset.Interface, namespace string, wf *wfv1.Workflow, opts *SubmitOpts) (*wfv1.Workflow, error)

SubmitWorkflow validates and submit a single workflow and override some of the fields of the workflow

func SuspendWorkflow

func SuspendWorkflow(wfIf v1alpha1.WorkflowInterface, workflowName string) error

SuspendWorkflow suspends a workflow by setting spec.suspend to true. Retries conflict errors

func TerminateWorkflow

func TerminateWorkflow(wfClient v1alpha1.WorkflowInterface, name string) error

TerminateWorkflow terminates a workflow by setting its activeDeadlineSeconds to 0

func ToUnstructured

func ToUnstructured(wf *wfv1.Workflow) (*unstructured.Unstructured, error)

ToUnstructured converts an workflow to an Unstructured object

func ValidateJsonStr

func ValidateJsonStr(jsonStr string, schema interface{}) bool

Types

type SubmitOpts

type SubmitOpts struct {
	Name           string                 // --name
	GenerateName   string                 // --generate-name
	InstanceID     string                 // --instanceid
	Entrypoint     string                 // --entrypoint
	Parameters     []string               // --parameter
	ParameterFile  string                 // --parameter-file
	ServiceAccount string                 // --serviceaccount
	DryRun         bool                   // --dry-run
	ServerDryRun   bool                   // --server-dry-run
	Labels         string                 // --labels
	OwnerReference *metav1.OwnerReference // useful if your custom controller creates argo workflow resources
}

SubmitOpts are workflow submission options

type WorkflowLister

type WorkflowLister interface {
	List() ([]*wfv1.Workflow, error)
}

WorkflowLister implements the List() method of v1alpha.WorkflowLister interface but does so using an Unstructured informer and converting objects to workflows. Ignores objects that failed to convert.

func NewWorkflowLister

func NewWorkflowLister(informer cache.SharedIndexInformer) WorkflowLister

NewWorkflowLister returns a new workflow lister

Jump to

Keyboard shortcuts

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