{"modulePath":"github.com/codefresh-io/argo-workflows","version":"v2.5.2+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package executor\n\n## Functions\n\n```go\nfunc LoadTemplate(path string) (*wfv1.Template, error)\n```\nLoadTemplate reads the template definition from the the Kubernetes downward api annotations volume file\n\n## Types\n\n```go\ntype ContainerRuntimeExecutor interface {\n\t// GetFileContents returns the file contents of a file in a container as a string\n\tGetFileContents(containerID string, sourcePath string) (string, error)\n\n\t// CopyFile copies a source file in a container to a local path\n\tCopyFile(containerID string, sourcePath string, destPath string) error\n\n\t// GetOutputStream returns the entirety of the container output as a io.Reader\n\t// Used to capture script results as an output parameter, and to archive container logs\n\tGetOutputStream(containerID string, combinedOutput bool) (io.ReadCloser, error)\n\n\t// WaitInit is called before Wait() to signal the executor about an impending Wait call.\n\t// For most executors this is a noop, and is only used by the the PNS executor\n\tWaitInit() error\n\n\t// Wait waits for the container to complete\n\tWait(containerID string) error\n\n\t// Kill a list of containerIDs first with a SIGTERM then with a SIGKILL after a grace period\n\tKill(containerIDs []string) error\n}\n```\nContainerRuntimeExecutor is the interface for interacting with a container runtime (e.g. docker)\n\n```go\ntype WorkflowExecutor struct {\n\tPodName            string\n\tTemplate           wfv1.Template\n\tClientSet          kubernetes.Interface\n\tNamespace          string\n\tPodAnnotationsPath string\n\tExecutionControl   *common.ExecutionControl\n\tRuntimeExecutor    ContainerRuntimeExecutor\n\t// contains filtered or unexported fields\n}\n```\nWorkflowExecutor is program which runs as the init/wait container\n\n```go\nfunc NewExecutor(clientset kubernetes.Interface, podName, namespace, podAnnotationsPath string, cre ContainerRuntimeExecutor, template wfv1.Template) WorkflowExecutor\n```\nNewExecutor instantiates a new workflow executor\n\n```go\nfunc (we *WorkflowExecutor) AddAnnotation(key, value string) error\n```\nAddAnnotation adds an annotation to the workflow pod\n\n```go\nfunc (we *WorkflowExecutor) AddError(err error)\n```\nAddError adds an error to the list of encountered errors durign execution\n\n```go\nfunc (we *WorkflowExecutor) AnnotateOutputs(logArt *wfv1.Artifact) error\n```\nAnnotateOutputs annotation to the pod indicating all the outputs.\n\n```go\nfunc (we *WorkflowExecutor) CaptureScriptResult() error\n```\nCaptureScriptResult will add the stdout of a script template as output result\n\n```go\nfunc (we *WorkflowExecutor) ExecResource(action string, manifestPath string) (string, string, error)\n```\nExecResource will run kubectl action against a manifest\n\n```go\nfunc (we *WorkflowExecutor) GetConfigMapKey(name, key string) (string, error)\n```\nGetConfigMapKey retrieves a configmap value and memoizes the result\n\n```go\nfunc (we *WorkflowExecutor) GetMainContainerID() (string, error)\n```\nGetMainContainerID returns the container id of the main container\n\n```go\nfunc (we *WorkflowExecutor) GetMainContainerStatus() (*apiv1.ContainerStatus, error)\n```\nGetMainContainerStatus returns the container status of the main container, nil if the main container does not exist\n\n```go\nfunc (we *WorkflowExecutor) GetSecret(accessKeyName string, accessKey string) (string, error)\n```\nGetSecret will retrieve the Secrets from VolumeMount\n\n```go\nfunc (we *WorkflowExecutor) GetSecrets(namespace, name, key string) ([]byte, error)\n```\nGetSecrets retrieves a secret value and memoizes the result\n\n```go\nfunc (we *WorkflowExecutor) HandleError()\n```\nHandleError is a helper to annotate the pod with the error message upon a unexpected executor panic or error\n\n```go\nfunc (we *WorkflowExecutor) InitDriver(art *wfv1.Artifact) (artifact.ArtifactDriver, error)\n```\nInitDriver initializes an instance of an artifact driver\n\n```go\nfunc (we *WorkflowExecutor) KillSidecars() error\n```\nKillSidecars kills any sidecars to the main container\n\n```go\nfunc (we *WorkflowExecutor) LoadArtifacts() error\n```\nLoadArtifacts loads artifacts from location to a container path\n\n```go\nfunc (we *WorkflowExecutor) LoadExecutionControl() error\n```\nLoadExecutionControl reads the execution control definition from the the Kubernetes downward api annotations volume file\n\n```go\nfunc (we *WorkflowExecutor) SaveArtifacts() error\n```\nSaveArtifacts uploads artifacts to the archive location\n\n```go\nfunc (we *WorkflowExecutor) SaveLogs() (*wfv1.Artifact, error)\n```\nSaveLogs saves logs\n\n```go\nfunc (we *WorkflowExecutor) SaveParameters() error\n```\nSaveParameters will save the content in the specified file path as output parameter value\n\n```go\nfunc (we *WorkflowExecutor) SaveResourceParameters(resourceNamespace string, resourceName string) error\n```\nSaveResourceParameters will save any resource output parameters\n\n```go\nfunc (we *WorkflowExecutor) StageFiles() error\n```\nStageFiles will create any files required by script/resource templates\n\n```go\nfunc (we *WorkflowExecutor) Wait() error\n```\nWait is the sidecar container logic which waits for the main container to complete. Also monitors for updates in the pod annotations which may change (e.g. terminate) Upon completion, kills any sidecars after it finishes.\n\n```go\nfunc (we *WorkflowExecutor) WaitResource(resourceNamespace string, resourceName string) error\n```\nWaitResource waits for a specific resource to satisfy either the success or failure condition\n\n","path":"github.com/codefresh-io/argo-workflows/workflow/executor","name":"executor","synopsis":"","isRedistributable":true}
