Documentation ¶
Index ¶
- func AddParamToGlobalScope(wf *wfv1.Workflow, log *log.Entry, param wfv1.Parameter) bool
- func ApplySubmitOpts(wf *wfv1.Workflow, opts *wfv1.SubmitOpts) error
- func ConvertYAMLToJSON(str string) (string, error)
- func CreateServerDryRun(ctx context.Context, wf *wfv1.Workflow, wfClientset wfclientset.Interface) (*wfv1.Workflow, error)
- func FindWaitCtrIndex(pod *apiv1.Pod) (int, error)
- func FormulateResubmitWorkflow(wf *wfv1.Workflow, memoized bool) (*wfv1.Workflow, error)
- func FromUnstructured(un *unstructured.Unstructured) (*wfv1.Workflow, error)
- func FromUnstructuredObj(un *unstructured.Unstructured, v interface{}) error
- func GetNodeType(tmpl *wfv1.Template) wfv1.NodeType
- func HasWindowsOSNodeSelector(nodeSelector map[string]string) bool
- func InstanceIDRequirement(instanceID string) labels.Requirement
- func IsJSONStr(str string) bool
- func IsWindowsUNCPath(path string, tmpl *wfv1.Template) bool
- func IsWorkflowCompleted(wf *wfv1.Workflow) bool
- func IsWorkflowSuspended(wf *wfv1.Workflow) bool
- func JoinWorkflowMetaData(wfMetaData, wfDefaultMetaData *metav1.ObjectMeta)
- func JoinWorkflowSpec(wfSpec, wftSpec, wfDefaultSpec *wfv1.WorkflowSpec) (*wfv1.Workflow, error)
- func MergeTo(patch, target *wfv1.Workflow) error
- func NewWorkflowInformer(dclient dynamic.Interface, ns string, resyncPeriod time.Duration, ...) cache.SharedIndexInformer
- func PodName(workflowName, nodeName, templateName, nodeID string, version PodNameVersion) string
- func PodSpecPatchMerge(wf *wfv1.Workflow, tmpl *wfv1.Template) (string, error)
- func PopulateSubmitOpts(command *cobra.Command, submitOpts *wfv1.SubmitOpts, parameterFile *string, ...)
- func RandSuffix() string
- func ReadFromFilePathsOrUrls(filePathsOrUrls ...string) ([][]byte, error)
- func ReadFromStdin() ([]byte, error)
- func ReadFromUrl(url string) ([]byte, error)
- func ReadManifest(manifestPaths ...string) ([][]byte, error)
- func ReadParametersFile(file string, opts *wfv1.SubmitOpts) error
- func ResumeWorkflow(ctx context.Context, wfIf v1alpha1.WorkflowInterface, ...) error
- func RetryWorkflow(ctx context.Context, kubeClient kubernetes.Interface, ...) (*wfv1.Workflow, error)
- func SelectorMatchesNode(selector fields.Selector, node wfv1.NodeStatus) bool
- func SetWorkflow(ctx context.Context, wfClient v1alpha1.WorkflowInterface, ...) error
- func StopWorkflow(ctx context.Context, wfClient v1alpha1.WorkflowInterface, ...) error
- func SubmitWorkflow(ctx context.Context, wfIf v1alpha1.WorkflowInterface, ...) (*wfv1.Workflow, error)
- func SuspendWorkflow(ctx context.Context, wfIf v1alpha1.WorkflowInterface, workflowName string) error
- func TerminateWorkflow(ctx context.Context, wfClient v1alpha1.WorkflowInterface, name string) error
- func ToUnstructured(wf *wfv1.Workflow) (*unstructured.Unstructured, error)
- type PodNameVersion
- type SetOperationValues
- type WorkflowLister
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddParamToGlobalScope ¶ added in v3.0.3
func ApplySubmitOpts ¶
func ApplySubmitOpts(wf *wfv1.Workflow, opts *wfv1.SubmitOpts) error
Apply the Submit options into workflow object
func ConvertYAMLToJSON ¶
func CreateServerDryRun ¶
func CreateServerDryRun(ctx context.Context, 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 ¶
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. This function performs a lot of allocations and con resulting in a lot of memory being used. Users should avoid invoking this function if the data they need is available from `unstructured.Unstructured`. especially if they're looping. Available values include: `GetLabels()`, `GetName()`, `GetNamespace()` etc. Single values can be accessed using `unstructured.Nested*`, e.g. `unstructured.NestedString(un.Object, "spec", "phase")`.
func FromUnstructuredObj ¶
func FromUnstructuredObj(un *unstructured.Unstructured, v interface{}) error
func HasWindowsOSNodeSelector ¶ added in v3.1.13
func InstanceIDRequirement ¶
func InstanceIDRequirement(instanceID string) labels.Requirement
InstanceIDRequirement returns the label requirement to filter against a controller instance (or not)
func IsWindowsUNCPath ¶ added in v3.1.13
IsWindowsUNCPath checks if path is prefixed with \\ This can be used to skip any processing of paths that point to SMB shares, local named pipes and local UNC path
func IsWorkflowCompleted ¶
IsWorkflowCompleted returns whether or not a workflow is considered completed
func IsWorkflowSuspended ¶
IsWorkflowSuspended returns whether or not a workflow is considered suspended
func JoinWorkflowMetaData ¶
func JoinWorkflowMetaData(wfMetaData, wfDefaultMetaData *metav1.ObjectMeta)
JoinWorkflowMetaData will join the workflow metadata with the following order of preference 1. Workflow, 2 WorkflowTemplate (WorkflowTemplateRef), 3. WorkflowDefault.
func JoinWorkflowSpec ¶
func JoinWorkflowSpec(wfSpec, wftSpec, wfDefaultSpec *wfv1.WorkflowSpec) (*wfv1.Workflow, error)
JoinWorkflowSpec will join the workflow specs with the following order of preference 1. Workflow Spec, 2 WorkflowTemplate Spec (WorkflowTemplateRef), 3. WorkflowDefault Spec.
func MergeTo ¶
MergeTo will merge one workflow (the "patch" workflow) into another (the "target" workflow. If the target workflow defines a field, this take precedence over the patch.
func NewWorkflowInformer ¶
func NewWorkflowInformer(dclient dynamic.Interface, ns string, resyncPeriod time.Duration, tweakListOptions internalinterfaces.TweakListOptionsFunc, indexers cache.Indexers) 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-workflows/issues/632
func PodName ¶ added in v3.2.0
func PodName(workflowName, nodeName, templateName, nodeID string, version PodNameVersion) string
PodName return a deterministic pod name
func PodSpecPatchMerge ¶
PodSpecPatchMerge will do strategic merge the workflow level PodSpecPatch and template level PodSpecPatch
func PopulateSubmitOpts ¶
func RandSuffix ¶ added in v3.3.0
func RandSuffix() string
RandSuffix generates a random suffix suitable for suffixing resource name.
func ReadFromFilePathsOrUrls ¶
ReadFromFilePathsOrUrls reads the content of a single or a list of file paths and/or urls
func ReadManifest ¶
ReadManifest reads from stdin, a single file/url, or a list of files and/or urls
func ReadParametersFile ¶ added in v3.3.2
func ReadParametersFile(file string, opts *wfv1.SubmitOpts) error
func ResumeWorkflow ¶
func ResumeWorkflow(ctx context.Context, wfIf v1alpha1.WorkflowInterface, hydrator hydrator.Interface, workflowName string, nodeFieldSelector 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(ctx context.Context, kubeClient kubernetes.Interface, hydrator hydrator.Interface, wfClient v1alpha1.WorkflowInterface, name string, restartSuccessful bool, nodeFieldSelector string) (*wfv1.Workflow, error)
RetryWorkflow updates a workflow, deleting all failed steps as well as the onExit node (and children)
func SelectorMatchesNode ¶
func SelectorMatchesNode(selector fields.Selector, node wfv1.NodeStatus) bool
func SetWorkflow ¶
func SetWorkflow(ctx context.Context, wfClient v1alpha1.WorkflowInterface, hydrator hydrator.Interface, name string, nodeFieldSelector string, values SetOperationValues) error
func StopWorkflow ¶
func StopWorkflow(ctx context.Context, wfClient v1alpha1.WorkflowInterface, hydrator hydrator.Interface, name string, nodeFieldSelector string, message string) error
StopWorkflow terminates a workflow by setting its spec.shutdown to ShutdownStrategyStop Or terminates a single resume step referenced by nodeFieldSelector
func SubmitWorkflow ¶
func SubmitWorkflow(ctx context.Context, wfIf v1alpha1.WorkflowInterface, wfClientset wfclientset.Interface, namespace string, wf *wfv1.Workflow, opts *wfv1.SubmitOpts) (*wfv1.Workflow, error)
SubmitWorkflow validates and submits a single workflow and overrides some of the fields of the workflow
func SuspendWorkflow ¶
func SuspendWorkflow(ctx context.Context, wfIf v1alpha1.WorkflowInterface, workflowName string) error
SuspendWorkflow suspends a workflow by setting spec.suspend to true. Retries conflict errors
func TerminateWorkflow ¶
TerminateWorkflow terminates a workflow by setting its spec.shutdown to ShutdownStrategyTerminate
func ToUnstructured ¶
func ToUnstructured(wf *wfv1.Workflow) (*unstructured.Unstructured, error)
ToUnstructured converts an workflow to an Unstructured object
Types ¶
type PodNameVersion ¶ added in v3.2.5
type PodNameVersion string
PodNameVersion stores which type of pod names should be used. v1 represents the node id. v2 is the combination of a node id and template name.
const ( // PodNameV1 is the v1 name that uses node ids for pod names PodNameV1 PodNameVersion = "v1" // PodNameV2 is the v2 name that uses node id combined with // the template name PodNameV2 PodNameVersion = "v2" )
func GetPodNameVersion ¶ added in v3.2.5
func GetPodNameVersion() PodNameVersion
GetPodNameVersion returns the pod name version to be used
func GetWorkflowPodNameVersion ¶ added in v3.2.7
func GetWorkflowPodNameVersion(wf *v1alpha1.Workflow) PodNameVersion
GetWorkflowPodNameVersion gets the pod name version from the annotation of a given workflow
func (PodNameVersion) String ¶ added in v3.2.5
func (v PodNameVersion) String() string
String stringifies the pod name version
type SetOperationValues ¶
type WorkflowLister ¶
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