Documentation
¶
Index ¶
- Constants
- Variables
- func Resource(resource string) schema.GroupResource
- type Arguments
- type Artifact
- type ArtifactLocation
- type GitArtifact
- type HTTPArtifact
- type Inputs
- type Item
- type NodeStatus
- type Outputs
- type Parameter
- type S3Artifact
- type S3Bucket
- type Script
- type Sidecar
- type SidecarOptions
- type Template
- type Workflow
- type WorkflowList
- type WorkflowSpec
- type WorkflowStatus
- type WorkflowStep
Constants ¶
const ( CRDKind string = "Workflow" CRDSingular string = "workflow" CRDPlural string = "workflows" CRDShortName string = "wf" CRDGroup string = "argoproj.io" CRDVersion string = "v1" CRDFullName string = CRDPlural + "." + CRDGroup )
CRD constants
const ( NodeStatusRunning = "Running" NodeStatusSucceeded = "Succeeded" NodeStatusSkipped = "Skipped" NodeStatusFailed = "Failed" NodeStatusError = "Error" )
Workflow and node statuses
Variables ¶
var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion}
Create a Rest client with the new CRD Schema
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group-qualified GroupResource.
Types ¶
type Arguments ¶
type Arguments struct {
Parameters []Parameter `json:"parameters,omitempty"`
Artifacts []Artifact `json:"artifacts,omitempty"`
}
Arguments to a template
func (*Arguments) GetArtifactByName ¶
func (*Arguments) GetParameterByName ¶
type Artifact ¶
type Artifact struct {
// name of the artifact. must be unique within a template's inputs/outputs.
Name string `json:"name"`
// Path is the container path to the artifact
Path string `json:"path,omitempty"`
// mode bits to use on this file, must be a value between 0 and 0777
// set when loading input artifacts.
Mode *int32 `json:"mode,omitempty"`
// From allows an artifact to reference an artifact from a previous step
From string `json:"from,omitempty"`
ArtifactLocation `json:",inline,squash"`
}
Artifact indicates an artifact to place at a specified path
func (*Artifact) HasLocation ¶
HasLocation whether or not an artifact has a location defined
type ArtifactLocation ¶
type ArtifactLocation struct {
S3 *S3Artifact `json:"s3,omitempty"`
Git *GitArtifact `json:"git,omitempty"`
HTTP *HTTPArtifact `json:"http,omitempty"`
}
ArtifactLocation describes a location for a single or multiple artifacts. It is used as single artifact in the context of inputs/outputs (e.g. outputs.artifacts.artname). It is also used to describe the location of multiple artifacts such as the archive location of a single workflow step, which the executor will use as a default location to store its files.
type GitArtifact ¶
type GitArtifact struct {
Repo string `json:"repo"`
Revision string `json:"revision,omitempty"`
UsernameSecret *apiv1.SecretKeySelector `json:"usernameSecret,omitempty"`
PasswordSecret *apiv1.SecretKeySelector `json:"passwordSecret,omitempty"`
}
type HTTPArtifact ¶
type HTTPArtifact struct {
URL string `json:"url"`
}
type Inputs ¶
type Inputs struct {
Parameters []Parameter `json:"parameters,omitempty"`
Artifacts []Artifact `json:"artifacts,omitempty"`
}
Inputs are the mechanism for passing parameters, artifacts, volumes from one template to another
func (*Inputs) GetArtifactByName ¶
func (*Inputs) GetParameterByName ¶
type NodeStatus ¶
type NodeStatus struct {
ID string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
// PodIP captures the IP of the pod for deamoned steps
PodIP string `json:"podIP,omitempty"`
// Daemoned tracks whether or not this node was daemoned and need to be terminated
Daemoned *bool `json:"daemoned,omitempty"`
// Outputs captures output parameter values and artifact locations
Outputs *Outputs `json:"outputs,omitempty"`
// Children is a list of child node IDs
Children []string `json:"children,omitempty"`
}
func (NodeStatus) Completed ¶
func (n NodeStatus) Completed() bool
Completed returns whether or not the node has completed execution
func (NodeStatus) String ¶
func (n NodeStatus) String() string
func (NodeStatus) Successful ¶
func (n NodeStatus) Successful() bool
type Outputs ¶
type Outputs struct {
Parameters []Parameter `json:"parameters,omitempty"`
Artifacts []Artifact `json:"artifacts,omitempty"`
Result *string `json:"result,omitempty"`
}
func (*Outputs) HasOutputs ¶
type Parameter ¶
type Parameter struct {
Name string `json:"name"`
Value *string `json:"value,omitempty"`
Default *string `json:"default,omitempty"`
Path string `json:"path,omitempty"`
}
Parameter indicate a passed string parameter to a service template with an optional default value
type S3Artifact ¶
type S3Bucket ¶
type S3Bucket struct {
Endpoint string `json:"endpoint"`
Bucket string `json:"bucket"`
Region string `json:"region,omitempty"`
Insecure *bool `json:"insecure,omitempty"`
AccessKeySecret apiv1.SecretKeySelector `json:"accessKeySecret"`
SecretKeySecret apiv1.SecretKeySelector `json:"secretKeySecret"`
}
type Script ¶
type Script struct {
Image string `json:"image"`
Command []string `json:"command"`
Source string `json:"source"`
}
Script is a template subtype to enable scripting through code steps
type Sidecar ¶
type Sidecar struct {
apiv1.Container `json:",inline,squash"`
SidecarOptions `json:",inline,squash"`
}
Sidecar is a container which runs alongside the main container
type SidecarOptions ¶
type SidecarOptions struct {
// MirrorVolumeMounts will mount the same volumes specified in the main container
// to the sidecar (including artifacts), at the same mountPaths. This enables
// dind daemon to partially see the same filesystem as the main container in
// order to use features such as docker volume binding
MirrorVolumeMounts *bool `json:"mirrorVolumeMounts,omitempty"`
}
SidecarOptions provide a way to customize the behavior of a sidecar and how it affects the main container.
type Template ¶
type Template struct {
Name string `json:"name"`
Inputs Inputs `json:"inputs,omitempty"`
Outputs Outputs `json:"outputs,omitempty"`
// Deamon indicates will allow a workflow to proceed to the next step if the container reaches readiness
Daemon *bool `json:"daemon,omitempty"`
// Workflow fields
Steps [][]WorkflowStep `json:"steps,omitempty"`
// Container
Container *apiv1.Container `json:"container,omitempty"`
// Script
Script *Script `json:"script,omitempty"`
// Sidecar containers
Sidecars []Sidecar `json:"sidecars,omitempty"`
// Location in which all files related to the step will be stored (logs, artifacts, etc...).
// Can be overridden by individual items in Outputs. If omitted, will use the default
// artifact repository location configured in the controller, appended with the
// <workflowname>/<nodename> in the key.
ArchiveLocation *ArtifactLocation `json:"archiveLocation,omitempty"`
}
type Workflow ¶
type Workflow struct {
metav1.TypeMeta `json:",inline,squash"`
metav1.ObjectMeta `json:"metadata"`
Spec WorkflowSpec `json:"spec"`
Status WorkflowStatus `json:"status"`
}
Workflow is the definition of our CRD Workflow class
func (*Workflow) DeepCopyObject ¶
func (*Workflow) GetTemplate ¶
type WorkflowList ¶
type WorkflowList struct {
metav1.TypeMeta `json:",inline,squash"`
metav1.ListMeta `json:"metadata"`
Items []Workflow `json:"items"`
}
func (*WorkflowList) DeepCopyObject ¶
func (wfl *WorkflowList) DeepCopyObject() runtime.Object
type WorkflowSpec ¶
type WorkflowSpec struct {
Templates []Template `json:"templates"`
Entrypoint string `json:"entrypoint"`
Arguments Arguments `json:"arguments,omitempty"`
Volumes []apiv1.Volume `json:"volumes,omitempty"`
VolumeClaimTemplates []apiv1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"`
Timeout string `json:"timeout,omitempty"`
}
type WorkflowStatus ¶
type WorkflowStatus struct {
Nodes map[string]NodeStatus `json:"nodes"`
PersistentVolumeClaims []apiv1.Volume `json:"persistentVolumeClaims,omitempty"`
}
type WorkflowStep ¶
type WorkflowStep struct {
Name string `json:"name,omitempty"`
Template string `json:"template,omitempty"`
Arguments Arguments `json:"arguments,omitempty"`
WithItems []Item `json:"withItems,omitempty"`
When string `json:"when,omitempty"`
}
WorkflowStep is a template ref
func (*WorkflowStep) DeepCopy ¶
func (s *WorkflowStep) DeepCopy() *WorkflowStep