repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens list | docstring stringlengths 6 2.61k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 85 252 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
argoproj/argo | workflow/common/util.go | SplitYAMLFile | func SplitYAMLFile(body []byte, strict bool) ([]wfv1.Workflow, error) {
manifestsStrings := yamlSeparator.Split(string(body), -1)
manifests := make([]wfv1.Workflow, 0)
for _, manifestStr := range manifestsStrings {
if strings.TrimSpace(manifestStr) == "" {
continue
}
var wf wfv1.Workflow
var opts []yaml.J... | go | func SplitYAMLFile(body []byte, strict bool) ([]wfv1.Workflow, error) {
manifestsStrings := yamlSeparator.Split(string(body), -1)
manifests := make([]wfv1.Workflow, 0)
for _, manifestStr := range manifestsStrings {
if strings.TrimSpace(manifestStr) == "" {
continue
}
var wf wfv1.Workflow
var opts []yaml.J... | [
"func",
"SplitYAMLFile",
"(",
"body",
"[",
"]",
"byte",
",",
"strict",
"bool",
")",
"(",
"[",
"]",
"wfv1",
".",
"Workflow",
",",
"error",
")",
"{",
"manifestsStrings",
":=",
"yamlSeparator",
".",
"Split",
"(",
"string",
"(",
"body",
")",
",",
"-",
"1... | // SplitYAMLFile is a helper to split a body into multiple workflow objects | [
"SplitYAMLFile",
"is",
"a",
"helper",
"to",
"split",
"a",
"body",
"into",
"multiple",
"workflow",
"objects"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/common/util.go#L480-L504 | train |
argoproj/argo | workflow/validate/lint.go | LintWorkflowDir | func LintWorkflowDir(dirPath string, strict bool) error {
walkFunc := func(path string, info os.FileInfo, err error) error {
if info == nil || info.IsDir() {
return nil
}
fileExt := filepath.Ext(info.Name())
switch fileExt {
case ".yaml", ".yml", ".json":
default:
return nil
}
return LintWorkflow... | go | func LintWorkflowDir(dirPath string, strict bool) error {
walkFunc := func(path string, info os.FileInfo, err error) error {
if info == nil || info.IsDir() {
return nil
}
fileExt := filepath.Ext(info.Name())
switch fileExt {
case ".yaml", ".yml", ".json":
default:
return nil
}
return LintWorkflow... | [
"func",
"LintWorkflowDir",
"(",
"dirPath",
"string",
",",
"strict",
"bool",
")",
"error",
"{",
"walkFunc",
":=",
"func",
"(",
"path",
"string",
",",
"info",
"os",
".",
"FileInfo",
",",
"err",
"error",
")",
"error",
"{",
"if",
"info",
"==",
"nil",
"||",... | // LintWorkflowDir validates all workflow manifests in a directory. Ignores non-workflow manifests | [
"LintWorkflowDir",
"validates",
"all",
"workflow",
"manifests",
"in",
"a",
"directory",
".",
"Ignores",
"non",
"-",
"workflow",
"manifests"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/validate/lint.go#L17-L31 | train |
argoproj/argo | workflow/validate/lint.go | LintWorkflowFile | func LintWorkflowFile(filePath string, strict bool) error {
body, err := ioutil.ReadFile(filePath)
if err != nil {
return errors.Errorf(errors.CodeBadRequest, "Can't read from file: %s, err: %v", filePath, err)
}
var workflows []wfv1.Workflow
if json.IsJSON(body) {
var wf wfv1.Workflow
if strict {
err = j... | go | func LintWorkflowFile(filePath string, strict bool) error {
body, err := ioutil.ReadFile(filePath)
if err != nil {
return errors.Errorf(errors.CodeBadRequest, "Can't read from file: %s, err: %v", filePath, err)
}
var workflows []wfv1.Workflow
if json.IsJSON(body) {
var wf wfv1.Workflow
if strict {
err = j... | [
"func",
"LintWorkflowFile",
"(",
"filePath",
"string",
",",
"strict",
"bool",
")",
"error",
"{",
"body",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"filePath",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"errors",
".",
"Errorf",
"(",
"er... | // LintWorkflowFile lints a json file, or multiple workflow manifest in a single yaml file. Ignores
// non-workflow manifests | [
"LintWorkflowFile",
"lints",
"a",
"json",
"file",
"or",
"multiple",
"workflow",
"manifest",
"in",
"a",
"single",
"yaml",
"file",
".",
"Ignores",
"non",
"-",
"workflow",
"manifests"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/validate/lint.go#L35-L70 | train |
argoproj/argo | workflow/executor/docker/docker.go | Kill | func (d *DockerExecutor) Kill(containerIDs []string) error {
killArgs := append([]string{"kill", "--signal", "TERM"}, containerIDs...)
err := common.RunCommand("docker", killArgs...)
if err != nil {
return errors.InternalWrapError(err)
}
waitArgs := append([]string{"wait"}, containerIDs...)
waitCmd := exec.Comm... | go | func (d *DockerExecutor) Kill(containerIDs []string) error {
killArgs := append([]string{"kill", "--signal", "TERM"}, containerIDs...)
err := common.RunCommand("docker", killArgs...)
if err != nil {
return errors.InternalWrapError(err)
}
waitArgs := append([]string{"wait"}, containerIDs...)
waitCmd := exec.Comm... | [
"func",
"(",
"d",
"*",
"DockerExecutor",
")",
"Kill",
"(",
"containerIDs",
"[",
"]",
"string",
")",
"error",
"{",
"killArgs",
":=",
"append",
"(",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
"}",
",",
"containerIDs",
"...... | // killContainers kills a list of containerIDs first with a SIGTERM then with a SIGKILL after a grace period | [
"killContainers",
"kills",
"a",
"list",
"of",
"containerIDs",
"first",
"with",
"a",
"SIGTERM",
"then",
"with",
"a",
"SIGKILL",
"after",
"a",
"grace",
"period"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/docker/docker.go#L99-L130 | train |
argoproj/argo | workflow/util/util.go | FromUnstructured | func FromUnstructured(un *unstructured.Unstructured) (*wfv1.Workflow, error) {
var wf wfv1.Workflow
err := runtime.DefaultUnstructuredConverter.FromUnstructured(un.Object, &wf)
return &wf, err
} | go | func FromUnstructured(un *unstructured.Unstructured) (*wfv1.Workflow, error) {
var wf wfv1.Workflow
err := runtime.DefaultUnstructuredConverter.FromUnstructured(un.Object, &wf)
return &wf, err
} | [
"func",
"FromUnstructured",
"(",
"un",
"*",
"unstructured",
".",
"Unstructured",
")",
"(",
"*",
"wfv1",
".",
"Workflow",
",",
"error",
")",
"{",
"var",
"wf",
"wfv1",
".",
"Workflow",
"\n",
"err",
":=",
"runtime",
".",
"DefaultUnstructuredConverter",
".",
"... | // FromUnstructured converts an unstructured object to a workflow | [
"FromUnstructured",
"converts",
"an",
"unstructured",
"object",
"to",
"a",
"workflow"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/util/util.go#L115-L119 | train |
argoproj/argo | workflow/util/util.go | ToUnstructured | func ToUnstructured(wf *wfv1.Workflow) (*unstructured.Unstructured, error) {
obj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(wf)
return &unstructured.Unstructured{Object: obj}, err
} | go | func ToUnstructured(wf *wfv1.Workflow) (*unstructured.Unstructured, error) {
obj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(wf)
return &unstructured.Unstructured{Object: obj}, err
} | [
"func",
"ToUnstructured",
"(",
"wf",
"*",
"wfv1",
".",
"Workflow",
")",
"(",
"*",
"unstructured",
".",
"Unstructured",
",",
"error",
")",
"{",
"obj",
",",
"err",
":=",
"runtime",
".",
"DefaultUnstructuredConverter",
".",
"ToUnstructured",
"(",
"wf",
")",
"... | // ToUnstructured converts an workflow to an Unstructured object | [
"ToUnstructured",
"converts",
"an",
"workflow",
"to",
"an",
"Unstructured",
"object"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/util/util.go#L122-L125 | train |
argoproj/argo | workflow/util/util.go | IsWorkflowCompleted | func IsWorkflowCompleted(wf *wfv1.Workflow) bool {
if wf.ObjectMeta.Labels != nil {
return wf.ObjectMeta.Labels[common.LabelKeyCompleted] == "true"
}
return false
} | go | func IsWorkflowCompleted(wf *wfv1.Workflow) bool {
if wf.ObjectMeta.Labels != nil {
return wf.ObjectMeta.Labels[common.LabelKeyCompleted] == "true"
}
return false
} | [
"func",
"IsWorkflowCompleted",
"(",
"wf",
"*",
"wfv1",
".",
"Workflow",
")",
"bool",
"{",
"if",
"wf",
".",
"ObjectMeta",
".",
"Labels",
"!=",
"nil",
"{",
"return",
"wf",
".",
"ObjectMeta",
".",
"Labels",
"[",
"common",
".",
"LabelKeyCompleted",
"]",
"=="... | // IsWorkflowCompleted returns whether or not a workflow is considered completed | [
"IsWorkflowCompleted",
"returns",
"whether",
"or",
"not",
"a",
"workflow",
"is",
"considered",
"completed"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/util/util.go#L128-L133 | train |
argoproj/argo | workflow/util/util.go | SuspendWorkflow | func SuspendWorkflow(wfIf v1alpha1.WorkflowInterface, workflowName string) error {
err := wait.ExponentialBackoff(retry.DefaultRetry, func() (bool, error) {
wf, err := wfIf.Get(workflowName, metav1.GetOptions{})
if err != nil {
return false, err
}
if IsWorkflowCompleted(wf) {
return false, errSuspendedCo... | go | func SuspendWorkflow(wfIf v1alpha1.WorkflowInterface, workflowName string) error {
err := wait.ExponentialBackoff(retry.DefaultRetry, func() (bool, error) {
wf, err := wfIf.Get(workflowName, metav1.GetOptions{})
if err != nil {
return false, err
}
if IsWorkflowCompleted(wf) {
return false, errSuspendedCo... | [
"func",
"SuspendWorkflow",
"(",
"wfIf",
"v1alpha1",
".",
"WorkflowInterface",
",",
"workflowName",
"string",
")",
"error",
"{",
"err",
":=",
"wait",
".",
"ExponentialBackoff",
"(",
"retry",
".",
"DefaultRetry",
",",
"func",
"(",
")",
"(",
"bool",
",",
"error... | // SuspendWorkflow suspends a workflow by setting spec.suspend to true. Retries conflict errors | [
"SuspendWorkflow",
"suspends",
"a",
"workflow",
"by",
"setting",
"spec",
".",
"suspend",
"to",
"true",
".",
"Retries",
"conflict",
"errors"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/util/util.go#L251-L276 | train |
argoproj/argo | workflow/util/util.go | ResumeWorkflow | func ResumeWorkflow(wfIf v1alpha1.WorkflowInterface, workflowName string) error {
err := wait.ExponentialBackoff(retry.DefaultRetry, func() (bool, error) {
wf, err := wfIf.Get(workflowName, metav1.GetOptions{})
if err != nil {
return false, err
}
updated := false
if wf.Spec.Suspend != nil && *wf.Spec.Susp... | go | func ResumeWorkflow(wfIf v1alpha1.WorkflowInterface, workflowName string) error {
err := wait.ExponentialBackoff(retry.DefaultRetry, func() (bool, error) {
wf, err := wfIf.Get(workflowName, metav1.GetOptions{})
if err != nil {
return false, err
}
updated := false
if wf.Spec.Suspend != nil && *wf.Spec.Susp... | [
"func",
"ResumeWorkflow",
"(",
"wfIf",
"v1alpha1",
".",
"WorkflowInterface",
",",
"workflowName",
"string",
")",
"error",
"{",
"err",
":=",
"wait",
".",
"ExponentialBackoff",
"(",
"retry",
".",
"DefaultRetry",
",",
"func",
"(",
")",
"(",
"bool",
",",
"error"... | // ResumeWorkflow resumes a workflow by setting spec.suspend to nil and any suspended nodes to Successful.
// Retries conflict errors | [
"ResumeWorkflow",
"resumes",
"a",
"workflow",
"by",
"setting",
"spec",
".",
"suspend",
"to",
"nil",
"and",
"any",
"suspended",
"nodes",
"to",
"Successful",
".",
"Retries",
"conflict",
"errors"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/util/util.go#L280-L315 | train |
argoproj/argo | workflow/util/util.go | convertNodeID | func convertNodeID(newWf *wfv1.Workflow, regex *regexp.Regexp, oldNodeID string, oldNodes map[string]wfv1.NodeStatus) string {
node := oldNodes[oldNodeID]
newNodeName := regex.ReplaceAllString(node.Name, newWf.ObjectMeta.Name)
return newWf.NodeID(newNodeName)
} | go | func convertNodeID(newWf *wfv1.Workflow, regex *regexp.Regexp, oldNodeID string, oldNodes map[string]wfv1.NodeStatus) string {
node := oldNodes[oldNodeID]
newNodeName := regex.ReplaceAllString(node.Name, newWf.ObjectMeta.Name)
return newWf.NodeID(newNodeName)
} | [
"func",
"convertNodeID",
"(",
"newWf",
"*",
"wfv1",
".",
"Workflow",
",",
"regex",
"*",
"regexp",
".",
"Regexp",
",",
"oldNodeID",
"string",
",",
"oldNodes",
"map",
"[",
"string",
"]",
"wfv1",
".",
"NodeStatus",
")",
"string",
"{",
"node",
":=",
"oldNode... | // convertNodeID converts an old nodeID to a new nodeID | [
"convertNodeID",
"converts",
"an",
"old",
"nodeID",
"to",
"a",
"new",
"nodeID"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/util/util.go#L428-L432 | train |
argoproj/argo | workflow/util/util.go | IsWorkflowSuspended | func IsWorkflowSuspended(wf *wfv1.Workflow) bool {
if wf.Spec.Suspend != nil && *wf.Spec.Suspend {
return true
}
for _, node := range wf.Status.Nodes {
if node.Type == wfv1.NodeTypeSuspend && node.Phase == wfv1.NodeRunning {
return true
}
}
return false
} | go | func IsWorkflowSuspended(wf *wfv1.Workflow) bool {
if wf.Spec.Suspend != nil && *wf.Spec.Suspend {
return true
}
for _, node := range wf.Status.Nodes {
if node.Type == wfv1.NodeTypeSuspend && node.Phase == wfv1.NodeRunning {
return true
}
}
return false
} | [
"func",
"IsWorkflowSuspended",
"(",
"wf",
"*",
"wfv1",
".",
"Workflow",
")",
"bool",
"{",
"if",
"wf",
".",
"Spec",
".",
"Suspend",
"!=",
"nil",
"&&",
"*",
"wf",
".",
"Spec",
".",
"Suspend",
"{",
"return",
"true",
"\n",
"}",
"\n",
"for",
"_",
",",
... | // IsWorkflowSuspended returns whether or not a workflow is considered suspended | [
"IsWorkflowSuspended",
"returns",
"whether",
"or",
"not",
"a",
"workflow",
"is",
"considered",
"suspended"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/util/util.go#L485-L495 | train |
argoproj/argo | workflow/util/util.go | TerminateWorkflow | func TerminateWorkflow(wfClient v1alpha1.WorkflowInterface, name string) error {
patchObj := map[string]interface{}{
"spec": map[string]interface{}{
"activeDeadlineSeconds": 0,
},
}
var err error
patch, err := json.Marshal(patchObj)
if err != nil {
return errors.InternalWrapError(err)
}
for attempt := 0... | go | func TerminateWorkflow(wfClient v1alpha1.WorkflowInterface, name string) error {
patchObj := map[string]interface{}{
"spec": map[string]interface{}{
"activeDeadlineSeconds": 0,
},
}
var err error
patch, err := json.Marshal(patchObj)
if err != nil {
return errors.InternalWrapError(err)
}
for attempt := 0... | [
"func",
"TerminateWorkflow",
"(",
"wfClient",
"v1alpha1",
".",
"WorkflowInterface",
",",
"name",
"string",
")",
"error",
"{",
"patchObj",
":=",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
"{",
"\"",
"\"",
":",
"map",
"[",
"string",
"]",
"interface",
... | // TerminateWorkflow terminates a workflow by setting its activeDeadlineSeconds to 0 | [
"TerminateWorkflow",
"terminates",
"a",
"workflow",
"by",
"setting",
"its",
"activeDeadlineSeconds",
"to",
"0"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/util/util.go#L505-L528 | train |
argoproj/argo | workflow/artifacts/artifactory/artifactory.go | Load | func (a *ArtifactoryArtifactDriver) Load(artifact *wfv1.Artifact, path string) error {
lf, err := os.Create(path)
if err != nil {
return err
}
defer func() {
_ = lf.Close()
}()
req, err := http.NewRequest(http.MethodGet, artifact.Artifactory.URL, nil)
if err != nil {
return err
}
req.SetBasicAuth(a.Use... | go | func (a *ArtifactoryArtifactDriver) Load(artifact *wfv1.Artifact, path string) error {
lf, err := os.Create(path)
if err != nil {
return err
}
defer func() {
_ = lf.Close()
}()
req, err := http.NewRequest(http.MethodGet, artifact.Artifactory.URL, nil)
if err != nil {
return err
}
req.SetBasicAuth(a.Use... | [
"func",
"(",
"a",
"*",
"ArtifactoryArtifactDriver",
")",
"Load",
"(",
"artifact",
"*",
"wfv1",
".",
"Artifact",
",",
"path",
"string",
")",
"error",
"{",
"lf",
",",
"err",
":=",
"os",
".",
"Create",
"(",
"path",
")",
"\n",
"if",
"err",
"!=",
"nil",
... | // Download artifact from an artifactory URL | [
"Download",
"artifact",
"from",
"an",
"artifactory",
"URL"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/artifacts/artifactory/artifactory.go#L18-L47 | train |
argoproj/argo | workflow/artifacts/artifactory/artifactory.go | Save | func (a *ArtifactoryArtifactDriver) Save(path string, artifact *wfv1.Artifact) error {
f, err := os.Open(path)
if err != nil {
return err
}
req, err := http.NewRequest(http.MethodPut, artifact.Artifactory.URL, f)
if err != nil {
return err
}
req.SetBasicAuth(a.Username, a.Password)
res, err := (&http.Clien... | go | func (a *ArtifactoryArtifactDriver) Save(path string, artifact *wfv1.Artifact) error {
f, err := os.Open(path)
if err != nil {
return err
}
req, err := http.NewRequest(http.MethodPut, artifact.Artifactory.URL, f)
if err != nil {
return err
}
req.SetBasicAuth(a.Username, a.Password)
res, err := (&http.Clien... | [
"func",
"(",
"a",
"*",
"ArtifactoryArtifactDriver",
")",
"Save",
"(",
"path",
"string",
",",
"artifact",
"*",
"wfv1",
".",
"Artifact",
")",
"error",
"{",
"f",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"path",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{... | // UpLoad artifact to an artifactory URL | [
"UpLoad",
"artifact",
"to",
"an",
"artifactory",
"URL"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/artifacts/artifactory/artifactory.go#L50-L72 | train |
argoproj/argo | cmd/workflow-controller/main.go | NewRootCommand | func NewRootCommand() *cobra.Command {
var (
clientConfig clientcmd.ClientConfig
configMap string // --configmap
executorImage string // --executor-image
executorImagePullPolicy string // --executor-image-pull-policy
logLevel string // --loglevel
glogLevel ... | go | func NewRootCommand() *cobra.Command {
var (
clientConfig clientcmd.ClientConfig
configMap string // --configmap
executorImage string // --executor-image
executorImagePullPolicy string // --executor-image-pull-policy
logLevel string // --loglevel
glogLevel ... | [
"func",
"NewRootCommand",
"(",
")",
"*",
"cobra",
".",
"Command",
"{",
"var",
"(",
"clientConfig",
"clientcmd",
".",
"ClientConfig",
"\n",
"configMap",
"string",
"// --configmap",
"\n",
"executorImage",
"string",
"// --executor-image",
"\n",
"executorImagePullPolicy",... | // NewRootCommand returns an new instance of the workflow-controller main entrypoint | [
"NewRootCommand",
"returns",
"an",
"new",
"instance",
"of",
"the",
"workflow",
"-",
"controller",
"main",
"entrypoint"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/cmd/workflow-controller/main.go#L30-L96 | train |
argoproj/argo | util/archive/archive.go | TarGzToWriter | func TarGzToWriter(sourcePath string, w io.Writer) error {
sourcePath, err := filepath.Abs(sourcePath)
if err != nil {
return errors.InternalErrorf("getting absolute path: %v", err)
}
log.Infof("Taring %s", sourcePath)
sourceFi, err := os.Stat(sourcePath)
if err != nil {
if os.IsNotExist(err) {
return erro... | go | func TarGzToWriter(sourcePath string, w io.Writer) error {
sourcePath, err := filepath.Abs(sourcePath)
if err != nil {
return errors.InternalErrorf("getting absolute path: %v", err)
}
log.Infof("Taring %s", sourcePath)
sourceFi, err := os.Stat(sourcePath)
if err != nil {
if os.IsNotExist(err) {
return erro... | [
"func",
"TarGzToWriter",
"(",
"sourcePath",
"string",
",",
"w",
"io",
".",
"Writer",
")",
"error",
"{",
"sourcePath",
",",
"err",
":=",
"filepath",
".",
"Abs",
"(",
"sourcePath",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"errors",
".",
"Inter... | // TarGzToWriter tar.gz's the source path to the supplied writer | [
"TarGzToWriter",
"tar",
".",
"gz",
"s",
"the",
"source",
"path",
"to",
"the",
"supplied",
"writer"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/util/archive/archive.go#L20-L48 | train |
argoproj/argo | workflow/controller/config.go | ResyncConfig | func (wfc *WorkflowController) ResyncConfig() error {
cmClient := wfc.kubeclientset.CoreV1().ConfigMaps(wfc.namespace)
cm, err := cmClient.Get(wfc.configMap, metav1.GetOptions{})
if err != nil {
return errors.InternalWrapError(err)
}
return wfc.updateConfig(cm)
} | go | func (wfc *WorkflowController) ResyncConfig() error {
cmClient := wfc.kubeclientset.CoreV1().ConfigMaps(wfc.namespace)
cm, err := cmClient.Get(wfc.configMap, metav1.GetOptions{})
if err != nil {
return errors.InternalWrapError(err)
}
return wfc.updateConfig(cm)
} | [
"func",
"(",
"wfc",
"*",
"WorkflowController",
")",
"ResyncConfig",
"(",
")",
"error",
"{",
"cmClient",
":=",
"wfc",
".",
"kubeclientset",
".",
"CoreV1",
"(",
")",
".",
"ConfigMaps",
"(",
"wfc",
".",
"namespace",
")",
"\n",
"cm",
",",
"err",
":=",
"cmC... | // ResyncConfig reloads the controller config from the configmap | [
"ResyncConfig",
"reloads",
"the",
"controller",
"config",
"from",
"the",
"configmap"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/config.go#L132-L139 | train |
argoproj/argo | workflow/controller/config.go | executorImage | func (wfc *WorkflowController) executorImage() string {
if wfc.cliExecutorImage != "" {
return wfc.cliExecutorImage
}
return wfc.Config.ExecutorImage
} | go | func (wfc *WorkflowController) executorImage() string {
if wfc.cliExecutorImage != "" {
return wfc.cliExecutorImage
}
return wfc.Config.ExecutorImage
} | [
"func",
"(",
"wfc",
"*",
"WorkflowController",
")",
"executorImage",
"(",
")",
"string",
"{",
"if",
"wfc",
".",
"cliExecutorImage",
"!=",
"\"",
"\"",
"{",
"return",
"wfc",
".",
"cliExecutorImage",
"\n",
"}",
"\n",
"return",
"wfc",
".",
"Config",
".",
"Ex... | // executorImage returns the image to use for the workflow executor | [
"executorImage",
"returns",
"the",
"image",
"to",
"use",
"for",
"the",
"workflow",
"executor"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/config.go#L162-L167 | train |
argoproj/argo | workflow/controller/config.go | executorImagePullPolicy | func (wfc *WorkflowController) executorImagePullPolicy() apiv1.PullPolicy {
if wfc.cliExecutorImagePullPolicy != "" {
return apiv1.PullPolicy(wfc.cliExecutorImagePullPolicy)
} else if wfc.Config.Executor != nil && wfc.Config.Executor.ImagePullPolicy != "" {
return wfc.Config.Executor.ImagePullPolicy
} else {
r... | go | func (wfc *WorkflowController) executorImagePullPolicy() apiv1.PullPolicy {
if wfc.cliExecutorImagePullPolicy != "" {
return apiv1.PullPolicy(wfc.cliExecutorImagePullPolicy)
} else if wfc.Config.Executor != nil && wfc.Config.Executor.ImagePullPolicy != "" {
return wfc.Config.Executor.ImagePullPolicy
} else {
r... | [
"func",
"(",
"wfc",
"*",
"WorkflowController",
")",
"executorImagePullPolicy",
"(",
")",
"apiv1",
".",
"PullPolicy",
"{",
"if",
"wfc",
".",
"cliExecutorImagePullPolicy",
"!=",
"\"",
"\"",
"{",
"return",
"apiv1",
".",
"PullPolicy",
"(",
"wfc",
".",
"cliExecutor... | // executorImagePullPolicy returns the imagePullPolicy to use for the workflow executor | [
"executorImagePullPolicy",
"returns",
"the",
"imagePullPolicy",
"to",
"use",
"for",
"the",
"workflow",
"executor"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/config.go#L170-L178 | train |
argoproj/argo | pkg/client/listers/workflow/v1alpha1/workflow.go | List | func (s *workflowLister) List(selector labels.Selector) (ret []*v1alpha1.Workflow, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.Workflow))
})
return ret, err
} | go | func (s *workflowLister) List(selector labels.Selector) (ret []*v1alpha1.Workflow, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.Workflow))
})
return ret, err
} | [
"func",
"(",
"s",
"*",
"workflowLister",
")",
"List",
"(",
"selector",
"labels",
".",
"Selector",
")",
"(",
"ret",
"[",
"]",
"*",
"v1alpha1",
".",
"Workflow",
",",
"err",
"error",
")",
"{",
"err",
"=",
"cache",
".",
"ListAll",
"(",
"s",
".",
"index... | // List lists all Workflows in the indexer. | [
"List",
"lists",
"all",
"Workflows",
"in",
"the",
"indexer",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/client/listers/workflow/v1alpha1/workflow.go#L32-L37 | train |
argoproj/argo | pkg/client/listers/workflow/v1alpha1/workflow.go | Workflows | func (s *workflowLister) Workflows(namespace string) WorkflowNamespaceLister {
return workflowNamespaceLister{indexer: s.indexer, namespace: namespace}
} | go | func (s *workflowLister) Workflows(namespace string) WorkflowNamespaceLister {
return workflowNamespaceLister{indexer: s.indexer, namespace: namespace}
} | [
"func",
"(",
"s",
"*",
"workflowLister",
")",
"Workflows",
"(",
"namespace",
"string",
")",
"WorkflowNamespaceLister",
"{",
"return",
"workflowNamespaceLister",
"{",
"indexer",
":",
"s",
".",
"indexer",
",",
"namespace",
":",
"namespace",
"}",
"\n",
"}"
] | // Workflows returns an object that can list and get Workflows. | [
"Workflows",
"returns",
"an",
"object",
"that",
"can",
"list",
"and",
"get",
"Workflows",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/client/listers/workflow/v1alpha1/workflow.go#L40-L42 | train |
argoproj/argo | pkg/client/listers/workflow/v1alpha1/workflow.go | List | func (s workflowNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Workflow, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.Workflow))
})
return ret, err
} | go | func (s workflowNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Workflow, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.Workflow))
})
return ret, err
} | [
"func",
"(",
"s",
"workflowNamespaceLister",
")",
"List",
"(",
"selector",
"labels",
".",
"Selector",
")",
"(",
"ret",
"[",
"]",
"*",
"v1alpha1",
".",
"Workflow",
",",
"err",
"error",
")",
"{",
"err",
"=",
"cache",
".",
"ListAllByNamespace",
"(",
"s",
... | // List lists all Workflows in the indexer for a given namespace. | [
"List",
"lists",
"all",
"Workflows",
"in",
"the",
"indexer",
"for",
"a",
"given",
"namespace",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/client/listers/workflow/v1alpha1/workflow.go#L61-L66 | train |
argoproj/argo | cmd/argo/commands/root.go | NewCommand | func NewCommand() *cobra.Command {
var command = &cobra.Command{
Use: CLIName,
Short: "argo is the command line interface to Argo",
Run: func(cmd *cobra.Command, args []string) {
cmd.HelpFunc()(cmd, args)
},
}
command.AddCommand(NewCompletionCommand())
command.AddCommand(NewDeleteCommand())
command.A... | go | func NewCommand() *cobra.Command {
var command = &cobra.Command{
Use: CLIName,
Short: "argo is the command line interface to Argo",
Run: func(cmd *cobra.Command, args []string) {
cmd.HelpFunc()(cmd, args)
},
}
command.AddCommand(NewCompletionCommand())
command.AddCommand(NewDeleteCommand())
command.A... | [
"func",
"NewCommand",
"(",
")",
"*",
"cobra",
".",
"Command",
"{",
"var",
"command",
"=",
"&",
"cobra",
".",
"Command",
"{",
"Use",
":",
"CLIName",
",",
"Short",
":",
"\"",
"\"",
",",
"Run",
":",
"func",
"(",
"cmd",
"*",
"cobra",
".",
"Command",
... | // NewCommand returns a new instance of an argo command | [
"NewCommand",
"returns",
"a",
"new",
"instance",
"of",
"an",
"argo",
"command"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/cmd/argo/commands/root.go#L17-L44 | train |
argoproj/argo | errors/errors.go | Errorf | func Errorf(code string, format string, args ...interface{}) error {
return New(code, fmt.Sprintf(format, args...))
} | go | func Errorf(code string, format string, args ...interface{}) error {
return New(code, fmt.Sprintf(format, args...))
} | [
"func",
"Errorf",
"(",
"code",
"string",
",",
"format",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"error",
"{",
"return",
"New",
"(",
"code",
",",
"fmt",
".",
"Sprintf",
"(",
"format",
",",
"args",
"...",
")",
")",
"\n",
"}"
] | // Errorf returns an error and formats according to a format specifier | [
"Errorf",
"returns",
"an",
"error",
"and",
"formats",
"according",
"to",
"a",
"format",
"specifier"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/errors/errors.go#L54-L56 | train |
argoproj/argo | errors/errors.go | InternalWrapError | func InternalWrapError(err error, message ...string) error {
if len(message) == 0 {
return Wrap(err, CodeInternal, err.Error())
}
return Wrap(err, CodeInternal, message[0])
} | go | func InternalWrapError(err error, message ...string) error {
if len(message) == 0 {
return Wrap(err, CodeInternal, err.Error())
}
return Wrap(err, CodeInternal, message[0])
} | [
"func",
"InternalWrapError",
"(",
"err",
"error",
",",
"message",
"...",
"string",
")",
"error",
"{",
"if",
"len",
"(",
"message",
")",
"==",
"0",
"{",
"return",
"Wrap",
"(",
"err",
",",
"CodeInternal",
",",
"err",
".",
"Error",
"(",
")",
")",
"\n",
... | // InternalWrapError annotates the error with the ERR_INTERNAL code and a stack trace, optional message | [
"InternalWrapError",
"annotates",
"the",
"error",
"with",
"the",
"ERR_INTERNAL",
"code",
"and",
"a",
"stack",
"trace",
"optional",
"message"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/errors/errors.go#L69-L74 | train |
argoproj/argo | errors/errors.go | InternalWrapErrorf | func InternalWrapErrorf(err error, format string, args ...interface{}) error {
return Wrap(err, CodeInternal, fmt.Sprintf(format, args...))
} | go | func InternalWrapErrorf(err error, format string, args ...interface{}) error {
return Wrap(err, CodeInternal, fmt.Sprintf(format, args...))
} | [
"func",
"InternalWrapErrorf",
"(",
"err",
"error",
",",
"format",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"error",
"{",
"return",
"Wrap",
"(",
"err",
",",
"CodeInternal",
",",
"fmt",
".",
"Sprintf",
"(",
"format",
",",
"args",
"...",
... | // InternalWrapErrorf annotates the error with the ERR_INTERNAL code and a stack trace, optional message | [
"InternalWrapErrorf",
"annotates",
"the",
"error",
"with",
"the",
"ERR_INTERNAL",
"code",
"and",
"a",
"stack",
"trace",
"optional",
"message"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/errors/errors.go#L77-L79 | train |
argoproj/argo | errors/errors.go | IsCode | func IsCode(code string, err error) bool {
if argoErr, ok := err.(argoerr); ok {
return argoErr.code == code
}
return false
} | go | func IsCode(code string, err error) bool {
if argoErr, ok := err.(argoerr); ok {
return argoErr.code == code
}
return false
} | [
"func",
"IsCode",
"(",
"code",
"string",
",",
"err",
"error",
")",
"bool",
"{",
"if",
"argoErr",
",",
"ok",
":=",
"err",
".",
"(",
"argoerr",
")",
";",
"ok",
"{",
"return",
"argoErr",
".",
"code",
"==",
"code",
"\n",
"}",
"\n",
"return",
"false",
... | // IsCode is a helper to determine if the error is of a specific code | [
"IsCode",
"is",
"a",
"helper",
"to",
"determine",
"if",
"the",
"error",
"is",
"of",
"a",
"specific",
"code"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/errors/errors.go#L155-L161 | train |
argoproj/argo | cmd/argo/commands/common.go | InitWorkflowClient | func InitWorkflowClient(ns ...string) v1alpha1.WorkflowInterface {
if wfClient != nil {
return wfClient
}
initKubeClient()
var namespace string
var err error
if len(ns) > 0 {
namespace = ns[0]
} else {
namespace, _, err = clientConfig.Namespace()
if err != nil {
log.Fatal(err)
}
}
wfcs := wfclient... | go | func InitWorkflowClient(ns ...string) v1alpha1.WorkflowInterface {
if wfClient != nil {
return wfClient
}
initKubeClient()
var namespace string
var err error
if len(ns) > 0 {
namespace = ns[0]
} else {
namespace, _, err = clientConfig.Namespace()
if err != nil {
log.Fatal(err)
}
}
wfcs := wfclient... | [
"func",
"InitWorkflowClient",
"(",
"ns",
"...",
"string",
")",
"v1alpha1",
".",
"WorkflowInterface",
"{",
"if",
"wfClient",
"!=",
"nil",
"{",
"return",
"wfClient",
"\n",
"}",
"\n",
"initKubeClient",
"(",
")",
"\n",
"var",
"namespace",
"string",
"\n",
"var",
... | // InitWorkflowClient creates a new client for the Kubernetes Workflow CRD. | [
"InitWorkflowClient",
"creates",
"a",
"new",
"client",
"for",
"the",
"Kubernetes",
"Workflow",
"CRD",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/cmd/argo/commands/common.go#L79-L97 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/types.go | Completed | func (n NodeStatus) Completed() bool {
return isCompletedPhase(n.Phase) || n.IsDaemoned() && n.Phase != NodePending
} | go | func (n NodeStatus) Completed() bool {
return isCompletedPhase(n.Phase) || n.IsDaemoned() && n.Phase != NodePending
} | [
"func",
"(",
"n",
"NodeStatus",
")",
"Completed",
"(",
")",
"bool",
"{",
"return",
"isCompletedPhase",
"(",
"n",
".",
"Phase",
")",
"||",
"n",
".",
"IsDaemoned",
"(",
")",
"&&",
"n",
".",
"Phase",
"!=",
"NodePending",
"\n",
"}"
] | // Remove returns whether or not the node has completed execution | [
"Remove",
"returns",
"whether",
"or",
"not",
"the",
"node",
"has",
"completed",
"execution"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/types.go#L608-L610 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/types.go | IsDaemoned | func (n NodeStatus) IsDaemoned() bool {
if n.Daemoned == nil || !*n.Daemoned {
return false
}
return true
} | go | func (n NodeStatus) IsDaemoned() bool {
if n.Daemoned == nil || !*n.Daemoned {
return false
}
return true
} | [
"func",
"(",
"n",
"NodeStatus",
")",
"IsDaemoned",
"(",
")",
"bool",
"{",
"if",
"n",
".",
"Daemoned",
"==",
"nil",
"||",
"!",
"*",
"n",
".",
"Daemoned",
"{",
"return",
"false",
"\n",
"}",
"\n",
"return",
"true",
"\n",
"}"
] | // IsDaemoned returns whether or not the node is deamoned | [
"IsDaemoned",
"returns",
"whether",
"or",
"not",
"the",
"node",
"is",
"deamoned"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/types.go#L613-L618 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/types.go | Successful | func (n NodeStatus) Successful() bool {
return n.Phase == NodeSucceeded || n.Phase == NodeSkipped || n.IsDaemoned() && n.Phase != NodePending
} | go | func (n NodeStatus) Successful() bool {
return n.Phase == NodeSucceeded || n.Phase == NodeSkipped || n.IsDaemoned() && n.Phase != NodePending
} | [
"func",
"(",
"n",
"NodeStatus",
")",
"Successful",
"(",
")",
"bool",
"{",
"return",
"n",
".",
"Phase",
"==",
"NodeSucceeded",
"||",
"n",
".",
"Phase",
"==",
"NodeSkipped",
"||",
"n",
".",
"IsDaemoned",
"(",
")",
"&&",
"n",
".",
"Phase",
"!=",
"NodePe... | // Successful returns whether or not this node completed successfully | [
"Successful",
"returns",
"whether",
"or",
"not",
"this",
"node",
"completed",
"successfully"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/types.go#L621-L623 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/types.go | GetType | func (tmpl *Template) GetType() TemplateType {
if tmpl.Container != nil {
return TemplateTypeContainer
}
if tmpl.Steps != nil {
return TemplateTypeSteps
}
if tmpl.DAG != nil {
return TemplateTypeDAG
}
if tmpl.Script != nil {
return TemplateTypeScript
}
if tmpl.Resource != nil {
return TemplateTypeRes... | go | func (tmpl *Template) GetType() TemplateType {
if tmpl.Container != nil {
return TemplateTypeContainer
}
if tmpl.Steps != nil {
return TemplateTypeSteps
}
if tmpl.DAG != nil {
return TemplateTypeDAG
}
if tmpl.Script != nil {
return TemplateTypeScript
}
if tmpl.Resource != nil {
return TemplateTypeRes... | [
"func",
"(",
"tmpl",
"*",
"Template",
")",
"GetType",
"(",
")",
"TemplateType",
"{",
"if",
"tmpl",
".",
"Container",
"!=",
"nil",
"{",
"return",
"TemplateTypeContainer",
"\n",
"}",
"\n",
"if",
"tmpl",
".",
"Steps",
"!=",
"nil",
"{",
"return",
"TemplateTy... | // GetType returns the type of this template | [
"GetType",
"returns",
"the",
"type",
"of",
"this",
"template"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/types.go#L838-L858 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/types.go | IsPodType | func (tmpl *Template) IsPodType() bool {
switch tmpl.GetType() {
case TemplateTypeContainer, TemplateTypeScript, TemplateTypeResource:
return true
}
return false
} | go | func (tmpl *Template) IsPodType() bool {
switch tmpl.GetType() {
case TemplateTypeContainer, TemplateTypeScript, TemplateTypeResource:
return true
}
return false
} | [
"func",
"(",
"tmpl",
"*",
"Template",
")",
"IsPodType",
"(",
")",
"bool",
"{",
"switch",
"tmpl",
".",
"GetType",
"(",
")",
"{",
"case",
"TemplateTypeContainer",
",",
"TemplateTypeScript",
",",
"TemplateTypeResource",
":",
"return",
"true",
"\n",
"}",
"\n",
... | // IsPodType returns whether or not the template is a pod type | [
"IsPodType",
"returns",
"whether",
"or",
"not",
"the",
"template",
"is",
"a",
"pod",
"type"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/types.go#L861-L867 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/types.go | IsLeaf | func (tmpl *Template) IsLeaf() bool {
switch tmpl.GetType() {
case TemplateTypeContainer, TemplateTypeScript:
return true
}
return false
} | go | func (tmpl *Template) IsLeaf() bool {
switch tmpl.GetType() {
case TemplateTypeContainer, TemplateTypeScript:
return true
}
return false
} | [
"func",
"(",
"tmpl",
"*",
"Template",
")",
"IsLeaf",
"(",
")",
"bool",
"{",
"switch",
"tmpl",
".",
"GetType",
"(",
")",
"{",
"case",
"TemplateTypeContainer",
",",
"TemplateTypeScript",
":",
"return",
"true",
"\n",
"}",
"\n",
"return",
"false",
"\n",
"}"
... | // IsLeaf returns whether or not the template is a leaf | [
"IsLeaf",
"returns",
"whether",
"or",
"not",
"the",
"template",
"is",
"a",
"leaf"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/types.go#L870-L876 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/types.go | GetArtifactByName | func (in *Inputs) GetArtifactByName(name string) *Artifact {
for _, art := range in.Artifacts {
if art.Name == name {
return &art
}
}
return nil
} | go | func (in *Inputs) GetArtifactByName(name string) *Artifact {
for _, art := range in.Artifacts {
if art.Name == name {
return &art
}
}
return nil
} | [
"func",
"(",
"in",
"*",
"Inputs",
")",
"GetArtifactByName",
"(",
"name",
"string",
")",
"*",
"Artifact",
"{",
"for",
"_",
",",
"art",
":=",
"range",
"in",
".",
"Artifacts",
"{",
"if",
"art",
".",
"Name",
"==",
"name",
"{",
"return",
"&",
"art",
"\n... | // GetArtifactByName returns an input artifact by its name | [
"GetArtifactByName",
"returns",
"an",
"input",
"artifact",
"by",
"its",
"name"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/types.go#L924-L931 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/types.go | GetParameterByName | func (in *Inputs) GetParameterByName(name string) *Parameter {
for _, param := range in.Parameters {
if param.Name == name {
return ¶m
}
}
return nil
} | go | func (in *Inputs) GetParameterByName(name string) *Parameter {
for _, param := range in.Parameters {
if param.Name == name {
return ¶m
}
}
return nil
} | [
"func",
"(",
"in",
"*",
"Inputs",
")",
"GetParameterByName",
"(",
"name",
"string",
")",
"*",
"Parameter",
"{",
"for",
"_",
",",
"param",
":=",
"range",
"in",
".",
"Parameters",
"{",
"if",
"param",
".",
"Name",
"==",
"name",
"{",
"return",
"&",
"para... | // GetParameterByName returns an input parameter by its name | [
"GetParameterByName",
"returns",
"an",
"input",
"parameter",
"by",
"its",
"name"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/types.go#L934-L941 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/types.go | HasInputs | func (in *Inputs) HasInputs() bool {
if len(in.Artifacts) > 0 {
return true
}
if len(in.Parameters) > 0 {
return true
}
return false
} | go | func (in *Inputs) HasInputs() bool {
if len(in.Artifacts) > 0 {
return true
}
if len(in.Parameters) > 0 {
return true
}
return false
} | [
"func",
"(",
"in",
"*",
"Inputs",
")",
"HasInputs",
"(",
")",
"bool",
"{",
"if",
"len",
"(",
"in",
".",
"Artifacts",
")",
">",
"0",
"{",
"return",
"true",
"\n",
"}",
"\n",
"if",
"len",
"(",
"in",
".",
"Parameters",
")",
">",
"0",
"{",
"return",... | // HasInputs returns whether or not there are any inputs | [
"HasInputs",
"returns",
"whether",
"or",
"not",
"there",
"are",
"any",
"inputs"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/types.go#L944-L952 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/types.go | HasOutputs | func (out *Outputs) HasOutputs() bool {
if out.Result != nil {
return true
}
if len(out.Artifacts) > 0 {
return true
}
if len(out.Parameters) > 0 {
return true
}
return false
} | go | func (out *Outputs) HasOutputs() bool {
if out.Result != nil {
return true
}
if len(out.Artifacts) > 0 {
return true
}
if len(out.Parameters) > 0 {
return true
}
return false
} | [
"func",
"(",
"out",
"*",
"Outputs",
")",
"HasOutputs",
"(",
")",
"bool",
"{",
"if",
"out",
".",
"Result",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n",
"if",
"len",
"(",
"out",
".",
"Artifacts",
")",
">",
"0",
"{",
"return",
"true",
"\n",
... | // HasOutputs returns whether or not there are any outputs | [
"HasOutputs",
"returns",
"whether",
"or",
"not",
"there",
"are",
"any",
"outputs"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/types.go#L955-L966 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/types.go | GetArtifactByName | func (args *Arguments) GetArtifactByName(name string) *Artifact {
for _, art := range args.Artifacts {
if art.Name == name {
return &art
}
}
return nil
} | go | func (args *Arguments) GetArtifactByName(name string) *Artifact {
for _, art := range args.Artifacts {
if art.Name == name {
return &art
}
}
return nil
} | [
"func",
"(",
"args",
"*",
"Arguments",
")",
"GetArtifactByName",
"(",
"name",
"string",
")",
"*",
"Artifact",
"{",
"for",
"_",
",",
"art",
":=",
"range",
"args",
".",
"Artifacts",
"{",
"if",
"art",
".",
"Name",
"==",
"name",
"{",
"return",
"&",
"art"... | // GetArtifactByName retrieves an artifact by its name | [
"GetArtifactByName",
"retrieves",
"an",
"artifact",
"by",
"its",
"name"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/types.go#L969-L976 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/types.go | GetParameterByName | func (args *Arguments) GetParameterByName(name string) *Parameter {
for _, param := range args.Parameters {
if param.Name == name {
return ¶m
}
}
return nil
} | go | func (args *Arguments) GetParameterByName(name string) *Parameter {
for _, param := range args.Parameters {
if param.Name == name {
return ¶m
}
}
return nil
} | [
"func",
"(",
"args",
"*",
"Arguments",
")",
"GetParameterByName",
"(",
"name",
"string",
")",
"*",
"Parameter",
"{",
"for",
"_",
",",
"param",
":=",
"range",
"args",
".",
"Parameters",
"{",
"if",
"param",
".",
"Name",
"==",
"name",
"{",
"return",
"&",
... | // GetParameterByName retrieves a parameter by its name | [
"GetParameterByName",
"retrieves",
"a",
"parameter",
"by",
"its",
"name"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/types.go#L979-L986 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/types.go | HasLocation | func (a *Artifact) HasLocation() bool {
return a.S3.HasLocation() ||
a.Git.HasLocation() ||
a.HTTP.HasLocation() ||
a.Artifactory.HasLocation() ||
a.Raw.HasLocation() ||
a.HDFS.HasLocation()
} | go | func (a *Artifact) HasLocation() bool {
return a.S3.HasLocation() ||
a.Git.HasLocation() ||
a.HTTP.HasLocation() ||
a.Artifactory.HasLocation() ||
a.Raw.HasLocation() ||
a.HDFS.HasLocation()
} | [
"func",
"(",
"a",
"*",
"Artifact",
")",
"HasLocation",
"(",
")",
"bool",
"{",
"return",
"a",
".",
"S3",
".",
"HasLocation",
"(",
")",
"||",
"a",
".",
"Git",
".",
"HasLocation",
"(",
")",
"||",
"a",
".",
"HTTP",
".",
"HasLocation",
"(",
")",
"||",... | // HasLocation whether or not an artifact has a location defined | [
"HasLocation",
"whether",
"or",
"not",
"an",
"artifact",
"has",
"a",
"location",
"defined"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/types.go#L989-L996 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/types.go | GetTemplate | func (wf *Workflow) GetTemplate(name string) *Template {
for _, t := range wf.Spec.Templates {
if t.Name == name {
return &t
}
}
return nil
} | go | func (wf *Workflow) GetTemplate(name string) *Template {
for _, t := range wf.Spec.Templates {
if t.Name == name {
return &t
}
}
return nil
} | [
"func",
"(",
"wf",
"*",
"Workflow",
")",
"GetTemplate",
"(",
"name",
"string",
")",
"*",
"Template",
"{",
"for",
"_",
",",
"t",
":=",
"range",
"wf",
".",
"Spec",
".",
"Templates",
"{",
"if",
"t",
".",
"Name",
"==",
"name",
"{",
"return",
"&",
"t"... | // GetTemplate retrieves a defined template by its name | [
"GetTemplate",
"retrieves",
"a",
"defined",
"template",
"by",
"its",
"name"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/types.go#L999-L1006 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/types.go | NodeID | func (wf *Workflow) NodeID(name string) string {
if name == wf.ObjectMeta.Name {
return wf.ObjectMeta.Name
}
h := fnv.New32a()
_, _ = h.Write([]byte(name))
return fmt.Sprintf("%s-%v", wf.ObjectMeta.Name, h.Sum32())
} | go | func (wf *Workflow) NodeID(name string) string {
if name == wf.ObjectMeta.Name {
return wf.ObjectMeta.Name
}
h := fnv.New32a()
_, _ = h.Write([]byte(name))
return fmt.Sprintf("%s-%v", wf.ObjectMeta.Name, h.Sum32())
} | [
"func",
"(",
"wf",
"*",
"Workflow",
")",
"NodeID",
"(",
"name",
"string",
")",
"string",
"{",
"if",
"name",
"==",
"wf",
".",
"ObjectMeta",
".",
"Name",
"{",
"return",
"wf",
".",
"ObjectMeta",
".",
"Name",
"\n",
"}",
"\n",
"h",
":=",
"fnv",
".",
"... | // NodeID creates a deterministic node ID based on a node name | [
"NodeID",
"creates",
"a",
"deterministic",
"node",
"ID",
"based",
"on",
"a",
"node",
"name"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/types.go#L1009-L1016 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/types.go | ContinuesOn | func (t *DAGTask) ContinuesOn(phase NodePhase) bool {
return continues(t.ContinueOn, phase)
} | go | func (t *DAGTask) ContinuesOn(phase NodePhase) bool {
return continues(t.ContinueOn, phase)
} | [
"func",
"(",
"t",
"*",
"DAGTask",
")",
"ContinuesOn",
"(",
"phase",
"NodePhase",
")",
"bool",
"{",
"return",
"continues",
"(",
"t",
".",
"ContinueOn",
",",
"phase",
")",
"\n",
"}"
] | // ContinuesOn returns whether the DAG should be proceeded if the task fails or errors. | [
"ContinuesOn",
"returns",
"whether",
"the",
"DAG",
"should",
"be",
"proceeded",
"if",
"the",
"task",
"fails",
"or",
"errors",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/types.go#L1041-L1043 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/types.go | ContinuesOn | func (s *WorkflowStep) ContinuesOn(phase NodePhase) bool {
return continues(s.ContinueOn, phase)
} | go | func (s *WorkflowStep) ContinuesOn(phase NodePhase) bool {
return continues(s.ContinueOn, phase)
} | [
"func",
"(",
"s",
"*",
"WorkflowStep",
")",
"ContinuesOn",
"(",
"phase",
"NodePhase",
")",
"bool",
"{",
"return",
"continues",
"(",
"s",
".",
"ContinueOn",
",",
"phase",
")",
"\n",
"}"
] | // ContinuesOn returns whether the StepGroup should be proceeded if the task fails or errors. | [
"ContinuesOn",
"returns",
"whether",
"the",
"StepGroup",
"should",
"be",
"proceeded",
"if",
"the",
"task",
"fails",
"or",
"errors",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/types.go#L1046-L1048 | train |
argoproj/argo | cmd/argo/commands/logs.go | PrintWorkflowLogs | func (p *logPrinter) PrintWorkflowLogs(workflow string) error {
wfClient := InitWorkflowClient()
wf, err := wfClient.Get(workflow, metav1.GetOptions{})
if err != nil {
return err
}
timeByPod := p.printRecentWorkflowLogs(wf)
if p.follow {
p.printLiveWorkflowLogs(wf.Name, wfClient, timeByPod)
}
return nil
} | go | func (p *logPrinter) PrintWorkflowLogs(workflow string) error {
wfClient := InitWorkflowClient()
wf, err := wfClient.Get(workflow, metav1.GetOptions{})
if err != nil {
return err
}
timeByPod := p.printRecentWorkflowLogs(wf)
if p.follow {
p.printLiveWorkflowLogs(wf.Name, wfClient, timeByPod)
}
return nil
} | [
"func",
"(",
"p",
"*",
"logPrinter",
")",
"PrintWorkflowLogs",
"(",
"workflow",
"string",
")",
"error",
"{",
"wfClient",
":=",
"InitWorkflowClient",
"(",
")",
"\n",
"wf",
",",
"err",
":=",
"wfClient",
".",
"Get",
"(",
"workflow",
",",
"metav1",
".",
"Get... | // PrintWorkflowLogs prints logs for all workflow pods | [
"PrintWorkflowLogs",
"prints",
"logs",
"for",
"all",
"workflow",
"pods"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/cmd/argo/commands/logs.go#L103-L114 | train |
argoproj/argo | cmd/argo/commands/logs.go | PrintPodLogs | func (p *logPrinter) PrintPodLogs(podName string) error {
namespace, _, err := clientConfig.Namespace()
if err != nil {
return err
}
var logs []logEntry
err = p.getPodLogs(context.Background(), "", podName, namespace, p.follow, p.tail, p.sinceSeconds, p.sinceTime, func(entry logEntry) {
logs = append(logs, ent... | go | func (p *logPrinter) PrintPodLogs(podName string) error {
namespace, _, err := clientConfig.Namespace()
if err != nil {
return err
}
var logs []logEntry
err = p.getPodLogs(context.Background(), "", podName, namespace, p.follow, p.tail, p.sinceSeconds, p.sinceTime, func(entry logEntry) {
logs = append(logs, ent... | [
"func",
"(",
"p",
"*",
"logPrinter",
")",
"PrintPodLogs",
"(",
"podName",
"string",
")",
"error",
"{",
"namespace",
",",
"_",
",",
"err",
":=",
"clientConfig",
".",
"Namespace",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}... | // PrintPodLogs prints logs for a single pod | [
"PrintPodLogs",
"prints",
"logs",
"for",
"a",
"single",
"pod"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/cmd/argo/commands/logs.go#L117-L133 | train |
argoproj/argo | cmd/argo/commands/logs.go | printRecentWorkflowLogs | func (p *logPrinter) printRecentWorkflowLogs(wf *v1alpha1.Workflow) map[string]*time.Time {
var podNodes []v1alpha1.NodeStatus
err := util.DecompressWorkflow(wf)
if err != nil {
log.Warn(err)
return nil
}
for _, node := range wf.Status.Nodes {
if node.Type == v1alpha1.NodeTypePod && node.Phase != v1alpha1.No... | go | func (p *logPrinter) printRecentWorkflowLogs(wf *v1alpha1.Workflow) map[string]*time.Time {
var podNodes []v1alpha1.NodeStatus
err := util.DecompressWorkflow(wf)
if err != nil {
log.Warn(err)
return nil
}
for _, node := range wf.Status.Nodes {
if node.Type == v1alpha1.NodeTypePod && node.Phase != v1alpha1.No... | [
"func",
"(",
"p",
"*",
"logPrinter",
")",
"printRecentWorkflowLogs",
"(",
"wf",
"*",
"v1alpha1",
".",
"Workflow",
")",
"map",
"[",
"string",
"]",
"*",
"time",
".",
"Time",
"{",
"var",
"podNodes",
"[",
"]",
"v1alpha1",
".",
"NodeStatus",
"\n",
"err",
":... | // Prints logs for workflow pod steps and return most recent log timestamp per pod name | [
"Prints",
"logs",
"for",
"workflow",
"pod",
"steps",
"and",
"return",
"most",
"recent",
"log",
"timestamp",
"per",
"pod",
"name"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/cmd/argo/commands/logs.go#L136-L190 | train |
argoproj/argo | cmd/argo/commands/logs.go | printLiveWorkflowLogs | func (p *logPrinter) printLiveWorkflowLogs(workflowName string, wfClient workflowv1.WorkflowInterface, timeByPod map[string]*time.Time) {
logs := make(chan logEntry)
streamedPods := make(map[string]bool)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
processPods := func(wf *v1alpha1.Workfl... | go | func (p *logPrinter) printLiveWorkflowLogs(workflowName string, wfClient workflowv1.WorkflowInterface, timeByPod map[string]*time.Time) {
logs := make(chan logEntry)
streamedPods := make(map[string]bool)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
processPods := func(wf *v1alpha1.Workfl... | [
"func",
"(",
"p",
"*",
"logPrinter",
")",
"printLiveWorkflowLogs",
"(",
"workflowName",
"string",
",",
"wfClient",
"workflowv1",
".",
"WorkflowInterface",
",",
"timeByPod",
"map",
"[",
"string",
"]",
"*",
"time",
".",
"Time",
")",
"{",
"logs",
":=",
"make",
... | // Prints live logs for workflow pods, starting from time specified in timeByPod name. | [
"Prints",
"live",
"logs",
"for",
"workflow",
"pods",
"starting",
"from",
"time",
"specified",
"in",
"timeByPod",
"name",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/cmd/argo/commands/logs.go#L193-L256 | train |
argoproj/argo | workflow/validate/validate.go | ValidateWorkflow | func ValidateWorkflow(wf *wfv1.Workflow, opts ValidateOpts) error {
ctx := wfValidationCtx{
ValidateOpts: opts,
wf: wf,
globalParams: make(map[string]string),
results: make(map[string]bool),
}
err := validateWorkflowFieldNames(wf.Spec.Templates)
if err != nil {
return errors.Errorf(errors.C... | go | func ValidateWorkflow(wf *wfv1.Workflow, opts ValidateOpts) error {
ctx := wfValidationCtx{
ValidateOpts: opts,
wf: wf,
globalParams: make(map[string]string),
results: make(map[string]bool),
}
err := validateWorkflowFieldNames(wf.Spec.Templates)
if err != nil {
return errors.Errorf(errors.C... | [
"func",
"ValidateWorkflow",
"(",
"wf",
"*",
"wfv1",
".",
"Workflow",
",",
"opts",
"ValidateOpts",
")",
"error",
"{",
"ctx",
":=",
"wfValidationCtx",
"{",
"ValidateOpts",
":",
"opts",
",",
"wf",
":",
"wf",
",",
"globalParams",
":",
"make",
"(",
"map",
"["... | // ValidateWorkflow accepts a workflow and performs validation against it. | [
"ValidateWorkflow",
"accepts",
"a",
"workflow",
"and",
"performs",
"validation",
"against",
"it",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/validate/validate.go#L55-L114 | train |
argoproj/argo | workflow/validate/validate.go | validateTemplateType | func validateTemplateType(tmpl *wfv1.Template) error {
numTypes := 0
for _, tmplType := range []interface{}{tmpl.Container, tmpl.Steps, tmpl.Script, tmpl.Resource, tmpl.DAG, tmpl.Suspend} {
if !reflect.ValueOf(tmplType).IsNil() {
numTypes++
}
}
switch numTypes {
case 0:
return errors.New(errors.CodeBadReq... | go | func validateTemplateType(tmpl *wfv1.Template) error {
numTypes := 0
for _, tmplType := range []interface{}{tmpl.Container, tmpl.Steps, tmpl.Script, tmpl.Resource, tmpl.DAG, tmpl.Suspend} {
if !reflect.ValueOf(tmplType).IsNil() {
numTypes++
}
}
switch numTypes {
case 0:
return errors.New(errors.CodeBadReq... | [
"func",
"validateTemplateType",
"(",
"tmpl",
"*",
"wfv1",
".",
"Template",
")",
"error",
"{",
"numTypes",
":=",
"0",
"\n",
"for",
"_",
",",
"tmplType",
":=",
"range",
"[",
"]",
"interface",
"{",
"}",
"{",
"tmpl",
".",
"Container",
",",
"tmpl",
".",
"... | // validateTemplateType validates that only one template type is defined | [
"validateTemplateType",
"validates",
"that",
"only",
"one",
"template",
"type",
"is",
"defined"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/validate/validate.go#L184-L199 | train |
argoproj/argo | workflow/validate/validate.go | checkValidWorkflowVariablePrefix | func checkValidWorkflowVariablePrefix(tag string) bool {
for _, rootTag := range common.GlobalVarValidWorkflowVariablePrefix {
if strings.HasPrefix(tag, rootTag) {
return true
}
}
return false
} | go | func checkValidWorkflowVariablePrefix(tag string) bool {
for _, rootTag := range common.GlobalVarValidWorkflowVariablePrefix {
if strings.HasPrefix(tag, rootTag) {
return true
}
}
return false
} | [
"func",
"checkValidWorkflowVariablePrefix",
"(",
"tag",
"string",
")",
"bool",
"{",
"for",
"_",
",",
"rootTag",
":=",
"range",
"common",
".",
"GlobalVarValidWorkflowVariablePrefix",
"{",
"if",
"strings",
".",
"HasPrefix",
"(",
"tag",
",",
"rootTag",
")",
"{",
... | // checkValidWorkflowVariablePrefix is a helper methood check variable starts workflow root elements | [
"checkValidWorkflowVariablePrefix",
"is",
"a",
"helper",
"methood",
"check",
"variable",
"starts",
"workflow",
"root",
"elements"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/validate/validate.go#L284-L291 | train |
argoproj/argo | workflow/validate/validate.go | validateArgumentsValues | func validateArgumentsValues(prefix string, arguments wfv1.Arguments) error {
for _, param := range arguments.Parameters {
if param.Value == nil {
return errors.Errorf(errors.CodeBadRequest, "%s%s.value is required", prefix, param.Name)
}
}
for _, art := range arguments.Artifacts {
if art.From == "" && !art... | go | func validateArgumentsValues(prefix string, arguments wfv1.Arguments) error {
for _, param := range arguments.Parameters {
if param.Value == nil {
return errors.Errorf(errors.CodeBadRequest, "%s%s.value is required", prefix, param.Name)
}
}
for _, art := range arguments.Artifacts {
if art.From == "" && !art... | [
"func",
"validateArgumentsValues",
"(",
"prefix",
"string",
",",
"arguments",
"wfv1",
".",
"Arguments",
")",
"error",
"{",
"for",
"_",
",",
"param",
":=",
"range",
"arguments",
".",
"Parameters",
"{",
"if",
"param",
".",
"Value",
"==",
"nil",
"{",
"return"... | // validateArgumentsValues ensures that all arguments have parameter values or artifact locations | [
"validateArgumentsValues",
"ensures",
"that",
"all",
"arguments",
"have",
"parameter",
"values",
"or",
"artifact",
"locations"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/validate/validate.go#L362-L374 | train |
argoproj/argo | workflow/validate/validate.go | validateBaseImageOutputs | func (ctx *wfValidationCtx) validateBaseImageOutputs(tmpl *wfv1.Template) error {
switch ctx.ContainerRuntimeExecutor {
case "", common.ContainerRuntimeExecutorDocker:
// docker executor supports all modes of artifact outputs
case common.ContainerRuntimeExecutorPNS:
// pns supports copying from the base image, b... | go | func (ctx *wfValidationCtx) validateBaseImageOutputs(tmpl *wfv1.Template) error {
switch ctx.ContainerRuntimeExecutor {
case "", common.ContainerRuntimeExecutorDocker:
// docker executor supports all modes of artifact outputs
case common.ContainerRuntimeExecutorPNS:
// pns supports copying from the base image, b... | [
"func",
"(",
"ctx",
"*",
"wfValidationCtx",
")",
"validateBaseImageOutputs",
"(",
"tmpl",
"*",
"wfv1",
".",
"Template",
")",
"error",
"{",
"switch",
"ctx",
".",
"ContainerRuntimeExecutor",
"{",
"case",
"\"",
"\"",
",",
"common",
".",
"ContainerRuntimeExecutorDoc... | // validateBaseImageOutputs detects if the template contains an output from | [
"validateBaseImageOutputs",
"detects",
"if",
"the",
"template",
"contains",
"an",
"output",
"from"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/validate/validate.go#L572-L614 | train |
argoproj/argo | workflow/validate/validate.go | validateOutputParameter | func validateOutputParameter(paramRef string, param *wfv1.Parameter) error {
if param.ValueFrom == nil {
return errors.Errorf(errors.CodeBadRequest, "%s.valueFrom not specified", paramRef)
}
paramTypes := 0
for _, value := range []string{param.ValueFrom.Path, param.ValueFrom.JQFilter, param.ValueFrom.JSONPath, pa... | go | func validateOutputParameter(paramRef string, param *wfv1.Parameter) error {
if param.ValueFrom == nil {
return errors.Errorf(errors.CodeBadRequest, "%s.valueFrom not specified", paramRef)
}
paramTypes := 0
for _, value := range []string{param.ValueFrom.Path, param.ValueFrom.JQFilter, param.ValueFrom.JSONPath, pa... | [
"func",
"validateOutputParameter",
"(",
"paramRef",
"string",
",",
"param",
"*",
"wfv1",
".",
"Parameter",
")",
"error",
"{",
"if",
"param",
".",
"ValueFrom",
"==",
"nil",
"{",
"return",
"errors",
".",
"Errorf",
"(",
"errors",
".",
"CodeBadRequest",
",",
"... | // validateOutputParameter verifies that only one of valueFrom is defined in an output | [
"validateOutputParameter",
"verifies",
"that",
"only",
"one",
"of",
"valueFrom",
"is",
"defined",
"in",
"an",
"output"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/validate/validate.go#L617-L635 | train |
argoproj/argo | workflow/validate/validate.go | verifyNoCycles | func verifyNoCycles(tmpl *wfv1.Template, nameToTask map[string]wfv1.DAGTask) error {
visited := make(map[string]bool)
var noCyclesHelper func(taskName string, cycle []string) error
noCyclesHelper = func(taskName string, cycle []string) error {
if _, ok := visited[taskName]; ok {
return nil
}
task := nameToT... | go | func verifyNoCycles(tmpl *wfv1.Template, nameToTask map[string]wfv1.DAGTask) error {
visited := make(map[string]bool)
var noCyclesHelper func(taskName string, cycle []string) error
noCyclesHelper = func(taskName string, cycle []string) error {
if _, ok := visited[taskName]; ok {
return nil
}
task := nameToT... | [
"func",
"verifyNoCycles",
"(",
"tmpl",
"*",
"wfv1",
".",
"Template",
",",
"nameToTask",
"map",
"[",
"string",
"]",
"wfv1",
".",
"DAGTask",
")",
"error",
"{",
"visited",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"bool",
")",
"\n",
"var",
"noCyclesHe... | // verifyNoCycles verifies there are no cycles in the DAG graph | [
"verifyNoCycles",
"verifies",
"there",
"are",
"no",
"cycles",
"in",
"the",
"DAG",
"graph"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/validate/validate.go#L799-L833 | train |
argoproj/argo | workflow/artifacts/http/http.go | Load | func (h *HTTPArtifactDriver) Load(inputArtifact *wfv1.Artifact, path string) error {
// Download the file to a local file path
return common.RunCommand("curl", "-sS", "-L", "-o", path, inputArtifact.HTTP.URL)
} | go | func (h *HTTPArtifactDriver) Load(inputArtifact *wfv1.Artifact, path string) error {
// Download the file to a local file path
return common.RunCommand("curl", "-sS", "-L", "-o", path, inputArtifact.HTTP.URL)
} | [
"func",
"(",
"h",
"*",
"HTTPArtifactDriver",
")",
"Load",
"(",
"inputArtifact",
"*",
"wfv1",
".",
"Artifact",
",",
"path",
"string",
")",
"error",
"{",
"// Download the file to a local file path",
"return",
"common",
".",
"RunCommand",
"(",
"\"",
"\"",
",",
"\... | // Load download artifacts from an HTTP URL | [
"Load",
"download",
"artifacts",
"from",
"an",
"HTTP",
"URL"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/artifacts/http/http.go#L13-L16 | train |
argoproj/argo | util/file/fileutil.go | ExistsInTar | func ExistsInTar(sourcePath string, tarReader TarReader) bool {
sourcePath = strings.Trim(sourcePath, "/")
for {
hdr, err := tarReader.Next()
if err == io.EOF {
break
}
if err != nil {
return false
}
if hdr.FileInfo().IsDir() && strings.Contains(sourcePath, strings.Trim(hdr.Name, "/")) {
return t... | go | func ExistsInTar(sourcePath string, tarReader TarReader) bool {
sourcePath = strings.Trim(sourcePath, "/")
for {
hdr, err := tarReader.Next()
if err == io.EOF {
break
}
if err != nil {
return false
}
if hdr.FileInfo().IsDir() && strings.Contains(sourcePath, strings.Trim(hdr.Name, "/")) {
return t... | [
"func",
"ExistsInTar",
"(",
"sourcePath",
"string",
",",
"tarReader",
"TarReader",
")",
"bool",
"{",
"sourcePath",
"=",
"strings",
".",
"Trim",
"(",
"sourcePath",
",",
"\"",
"\"",
")",
"\n",
"for",
"{",
"hdr",
",",
"err",
":=",
"tarReader",
".",
"Next",
... | // ExistsInTar return true if file or directory exists in tar | [
"ExistsInTar",
"return",
"true",
"if",
"file",
"or",
"directory",
"exists",
"in",
"tar"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/util/file/fileutil.go#L20-L38 | train |
argoproj/argo | util/file/fileutil.go | close | func close(f io.Closer) {
err := f.Close()
if err != nil {
log.Warnf("Failed to close the file/writer/reader. %v", err)
}
} | go | func close(f io.Closer) {
err := f.Close()
if err != nil {
log.Warnf("Failed to close the file/writer/reader. %v", err)
}
} | [
"func",
"close",
"(",
"f",
"io",
".",
"Closer",
")",
"{",
"err",
":=",
"f",
".",
"Close",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"log",
".",
"Warnf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"}"
] | //Close the file | [
"Close",
"the",
"file"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/util/file/fileutil.go#L41-L46 | train |
argoproj/argo | util/file/fileutil.go | CompressEncodeString | func CompressEncodeString(content string) string {
return base64.StdEncoding.EncodeToString(CompressContent([]byte(content)))
} | go | func CompressEncodeString(content string) string {
return base64.StdEncoding.EncodeToString(CompressContent([]byte(content)))
} | [
"func",
"CompressEncodeString",
"(",
"content",
"string",
")",
"string",
"{",
"return",
"base64",
".",
"StdEncoding",
".",
"EncodeToString",
"(",
"CompressContent",
"(",
"[",
"]",
"byte",
"(",
"content",
")",
")",
")",
"\n",
"}"
] | // CompressEncodeString will return the compressed string with base64 encoded | [
"CompressEncodeString",
"will",
"return",
"the",
"compressed",
"string",
"with",
"base64",
"encoded"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/util/file/fileutil.go#L49-L51 | train |
argoproj/argo | util/file/fileutil.go | DecodeDecompressString | func DecodeDecompressString(content string) (string, error) {
buf, err := base64.StdEncoding.DecodeString(content)
if err != nil {
return "", err
}
dBuf, err := DecompressContent(buf)
if err != nil {
return "", err
}
return string(dBuf), nil
} | go | func DecodeDecompressString(content string) (string, error) {
buf, err := base64.StdEncoding.DecodeString(content)
if err != nil {
return "", err
}
dBuf, err := DecompressContent(buf)
if err != nil {
return "", err
}
return string(dBuf), nil
} | [
"func",
"DecodeDecompressString",
"(",
"content",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"buf",
",",
"err",
":=",
"base64",
".",
"StdEncoding",
".",
"DecodeString",
"(",
"content",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
... | // DecodeDecompressString will return decode and decompress the | [
"DecodeDecompressString",
"will",
"return",
"decode",
"and",
"decompress",
"the"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/util/file/fileutil.go#L54-L65 | train |
argoproj/argo | util/file/fileutil.go | CompressContent | func CompressContent(content []byte) []byte {
var buf bytes.Buffer
zipWriter := gzip.NewWriter(&buf)
_, err := zipWriter.Write(content)
if err != nil {
log.Warnf("Error in compressing: %v", err)
}
close(zipWriter)
return buf.Bytes()
} | go | func CompressContent(content []byte) []byte {
var buf bytes.Buffer
zipWriter := gzip.NewWriter(&buf)
_, err := zipWriter.Write(content)
if err != nil {
log.Warnf("Error in compressing: %v", err)
}
close(zipWriter)
return buf.Bytes()
} | [
"func",
"CompressContent",
"(",
"content",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"var",
"buf",
"bytes",
".",
"Buffer",
"\n",
"zipWriter",
":=",
"gzip",
".",
"NewWriter",
"(",
"&",
"buf",
")",
"\n\n",
"_",
",",
"err",
":=",
"zipWriter",
".",
... | // CompressContent will compress the byte array using zip writer | [
"CompressContent",
"will",
"compress",
"the",
"byte",
"array",
"using",
"zip",
"writer"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/util/file/fileutil.go#L68-L78 | train |
argoproj/argo | util/file/fileutil.go | DecompressContent | func DecompressContent(content []byte) ([]byte, error) {
buf := bytes.NewReader(content)
gZipReader, _ := gzip.NewReader(buf)
defer close(gZipReader)
return ioutil.ReadAll(gZipReader)
} | go | func DecompressContent(content []byte) ([]byte, error) {
buf := bytes.NewReader(content)
gZipReader, _ := gzip.NewReader(buf)
defer close(gZipReader)
return ioutil.ReadAll(gZipReader)
} | [
"func",
"DecompressContent",
"(",
"content",
"[",
"]",
"byte",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"buf",
":=",
"bytes",
".",
"NewReader",
"(",
"content",
")",
"\n",
"gZipReader",
",",
"_",
":=",
"gzip",
".",
"NewReader",
"(",
"buf",
... | // DecompressContent will return the uncompressed content | [
"DecompressContent",
"will",
"return",
"the",
"uncompressed",
"content"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/util/file/fileutil.go#L81-L87 | train |
argoproj/argo | workflow/executor/common/common.go | GetContainerID | func GetContainerID(container *v1.ContainerStatus) string {
i := strings.Index(container.ContainerID, containerShimPrefix)
if i == -1 {
return ""
}
return container.ContainerID[i+len(containerShimPrefix):]
} | go | func GetContainerID(container *v1.ContainerStatus) string {
i := strings.Index(container.ContainerID, containerShimPrefix)
if i == -1 {
return ""
}
return container.ContainerID[i+len(containerShimPrefix):]
} | [
"func",
"GetContainerID",
"(",
"container",
"*",
"v1",
".",
"ContainerStatus",
")",
"string",
"{",
"i",
":=",
"strings",
".",
"Index",
"(",
"container",
".",
"ContainerID",
",",
"containerShimPrefix",
")",
"\n",
"if",
"i",
"==",
"-",
"1",
"{",
"return",
... | // GetContainerID returns container ID of a ContainerStatus resource | [
"GetContainerID",
"returns",
"container",
"ID",
"of",
"a",
"ContainerStatus",
"resource"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/common/common.go#L25-L31 | train |
argoproj/argo | workflow/executor/common/common.go | TerminatePodWithContainerID | func TerminatePodWithContainerID(c KubernetesClientInterface, containerID string, sig syscall.Signal) error {
pod, container, err := c.GetContainerStatus(containerID)
if err != nil {
return err
}
if container.State.Terminated != nil {
log.Infof("Container %s is already terminated: %v", container.ContainerID, co... | go | func TerminatePodWithContainerID(c KubernetesClientInterface, containerID string, sig syscall.Signal) error {
pod, container, err := c.GetContainerStatus(containerID)
if err != nil {
return err
}
if container.State.Terminated != nil {
log.Infof("Container %s is already terminated: %v", container.ContainerID, co... | [
"func",
"TerminatePodWithContainerID",
"(",
"c",
"KubernetesClientInterface",
",",
"containerID",
"string",
",",
"sig",
"syscall",
".",
"Signal",
")",
"error",
"{",
"pod",
",",
"container",
",",
"err",
":=",
"c",
".",
"GetContainerStatus",
"(",
"containerID",
")... | // TerminatePodWithContainerID invoke the given SIG against the PID1 of the container.
// No-op if the container is on the hostPID | [
"TerminatePodWithContainerID",
"invoke",
"the",
"given",
"SIG",
"against",
"the",
"PID1",
"of",
"the",
"container",
".",
"No",
"-",
"op",
"if",
"the",
"container",
"is",
"on",
"the",
"hostPID"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/common/common.go#L72-L88 | train |
argoproj/argo | workflow/executor/common/common.go | KillGracefully | func KillGracefully(c KubernetesClientInterface, containerID string) error {
log.Infof("SIGTERM containerID %q: %s", containerID, syscall.SIGTERM.String())
err := TerminatePodWithContainerID(c, containerID, syscall.SIGTERM)
if err != nil {
return err
}
err = WaitForTermination(c, containerID, time.Second*KillGra... | go | func KillGracefully(c KubernetesClientInterface, containerID string) error {
log.Infof("SIGTERM containerID %q: %s", containerID, syscall.SIGTERM.String())
err := TerminatePodWithContainerID(c, containerID, syscall.SIGTERM)
if err != nil {
return err
}
err = WaitForTermination(c, containerID, time.Second*KillGra... | [
"func",
"KillGracefully",
"(",
"c",
"KubernetesClientInterface",
",",
"containerID",
"string",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"containerID",
",",
"syscall",
".",
"SIGTERM",
".",
"String",
"(",
")",
")",
"\n",
"err",
":=",
"... | // KillGracefully kills a container gracefully. | [
"KillGracefully",
"kills",
"a",
"container",
"gracefully",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/common/common.go#L91-L113 | train |
argoproj/argo | workflow/executor/common/common.go | CopyArchive | func CopyArchive(c KubernetesClientInterface, containerID, sourcePath, destPath string) error {
log.Infof("Archiving %s:%s to %s", containerID, sourcePath, destPath)
b, err := c.CreateArchive(containerID, sourcePath)
if err != nil {
return err
}
f, err := os.OpenFile(destPath, os.O_CREATE|os.O_TRUNC|os.O_WRONLY,... | go | func CopyArchive(c KubernetesClientInterface, containerID, sourcePath, destPath string) error {
log.Infof("Archiving %s:%s to %s", containerID, sourcePath, destPath)
b, err := c.CreateArchive(containerID, sourcePath)
if err != nil {
return err
}
f, err := os.OpenFile(destPath, os.O_CREATE|os.O_TRUNC|os.O_WRONLY,... | [
"func",
"CopyArchive",
"(",
"c",
"KubernetesClientInterface",
",",
"containerID",
",",
"sourcePath",
",",
"destPath",
"string",
")",
"error",
"{",
"log",
".",
"Infof",
"(",
"\"",
"\"",
",",
"containerID",
",",
"sourcePath",
",",
"destPath",
")",
"\n",
"b",
... | // CopyArchive downloads files and directories as a tarball and saves it to a specified path. | [
"CopyArchive",
"downloads",
"files",
"and",
"directories",
"as",
"a",
"tarball",
"and",
"saves",
"it",
"to",
"a",
"specified",
"path",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/common/common.go#L116-L140 | train |
argoproj/argo | workflow/controller/workflowpod.go | substitutePodParams | func substitutePodParams(pod *apiv1.Pod, podParams map[string]string) (*apiv1.Pod, error) {
newPodParams := make(map[string]string)
for k, v := range podParams {
newPodParams[k] = v
}
newPodParams[common.LocalVarPodName] = pod.Name
podParams = newPodParams
specBytes, err := json.Marshal(pod)
if err != nil {
... | go | func substitutePodParams(pod *apiv1.Pod, podParams map[string]string) (*apiv1.Pod, error) {
newPodParams := make(map[string]string)
for k, v := range podParams {
newPodParams[k] = v
}
newPodParams[common.LocalVarPodName] = pod.Name
podParams = newPodParams
specBytes, err := json.Marshal(pod)
if err != nil {
... | [
"func",
"substitutePodParams",
"(",
"pod",
"*",
"apiv1",
".",
"Pod",
",",
"podParams",
"map",
"[",
"string",
"]",
"string",
")",
"(",
"*",
"apiv1",
".",
"Pod",
",",
"error",
")",
"{",
"newPodParams",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"str... | // substitutePodParams returns a pod spec with parameter references substituted as well as pod.name | [
"substitutePodParams",
"returns",
"a",
"pod",
"spec",
"with",
"parameter",
"references",
"substituted",
"as",
"well",
"as",
"pod",
".",
"name"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/workflowpod.go#L229-L251 | train |
argoproj/argo | workflow/controller/workflowpod.go | hasPrivilegedContainers | func hasPrivilegedContainers(tmpl *wfv1.Template) bool {
if containerIsPrivileged(tmpl.Container) {
return true
}
for _, side := range tmpl.Sidecars {
if containerIsPrivileged(&side.Container) {
return true
}
}
return false
} | go | func hasPrivilegedContainers(tmpl *wfv1.Template) bool {
if containerIsPrivileged(tmpl.Container) {
return true
}
for _, side := range tmpl.Sidecars {
if containerIsPrivileged(&side.Container) {
return true
}
}
return false
} | [
"func",
"hasPrivilegedContainers",
"(",
"tmpl",
"*",
"wfv1",
".",
"Template",
")",
"bool",
"{",
"if",
"containerIsPrivileged",
"(",
"tmpl",
".",
"Container",
")",
"{",
"return",
"true",
"\n",
"}",
"\n",
"for",
"_",
",",
"side",
":=",
"range",
"tmpl",
"."... | // hasPrivilegedContainers tests if the main container or sidecars is privileged | [
"hasPrivilegedContainers",
"tests",
"if",
"the",
"main",
"container",
"or",
"sidecars",
"is",
"privileged"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/workflowpod.go#L284-L294 | train |
argoproj/argo | workflow/controller/workflowpod.go | addMetadata | func (woc *wfOperationCtx) addMetadata(pod *apiv1.Pod, tmpl *wfv1.Template) {
for k, v := range tmpl.Metadata.Annotations {
pod.ObjectMeta.Annotations[k] = v
}
for k, v := range tmpl.Metadata.Labels {
pod.ObjectMeta.Labels[k] = v
}
if woc.workflowDeadline != nil {
execCtl := common.ExecutionControl{
Deadl... | go | func (woc *wfOperationCtx) addMetadata(pod *apiv1.Pod, tmpl *wfv1.Template) {
for k, v := range tmpl.Metadata.Annotations {
pod.ObjectMeta.Annotations[k] = v
}
for k, v := range tmpl.Metadata.Labels {
pod.ObjectMeta.Labels[k] = v
}
if woc.workflowDeadline != nil {
execCtl := common.ExecutionControl{
Deadl... | [
"func",
"(",
"woc",
"*",
"wfOperationCtx",
")",
"addMetadata",
"(",
"pod",
"*",
"apiv1",
".",
"Pod",
",",
"tmpl",
"*",
"wfv1",
".",
"Template",
")",
"{",
"for",
"k",
",",
"v",
":=",
"range",
"tmpl",
".",
"Metadata",
".",
"Annotations",
"{",
"pod",
... | // addMetadata applies metadata specified in the template | [
"addMetadata",
"applies",
"metadata",
"specified",
"in",
"the",
"template"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/workflowpod.go#L429-L446 | train |
argoproj/argo | workflow/controller/workflowpod.go | addSchedulingConstraints | func addSchedulingConstraints(pod *apiv1.Pod, wfSpec *wfv1.WorkflowSpec, tmpl *wfv1.Template) {
// Set nodeSelector (if specified)
if len(tmpl.NodeSelector) > 0 {
pod.Spec.NodeSelector = tmpl.NodeSelector
} else if len(wfSpec.NodeSelector) > 0 {
pod.Spec.NodeSelector = wfSpec.NodeSelector
}
// Set affinity (if... | go | func addSchedulingConstraints(pod *apiv1.Pod, wfSpec *wfv1.WorkflowSpec, tmpl *wfv1.Template) {
// Set nodeSelector (if specified)
if len(tmpl.NodeSelector) > 0 {
pod.Spec.NodeSelector = tmpl.NodeSelector
} else if len(wfSpec.NodeSelector) > 0 {
pod.Spec.NodeSelector = wfSpec.NodeSelector
}
// Set affinity (if... | [
"func",
"addSchedulingConstraints",
"(",
"pod",
"*",
"apiv1",
".",
"Pod",
",",
"wfSpec",
"*",
"wfv1",
".",
"WorkflowSpec",
",",
"tmpl",
"*",
"wfv1",
".",
"Template",
")",
"{",
"// Set nodeSelector (if specified)",
"if",
"len",
"(",
"tmpl",
".",
"NodeSelector",... | // addSchedulingConstraints applies any node selectors or affinity rules to the pod, either set in the workflow or the template | [
"addSchedulingConstraints",
"applies",
"any",
"node",
"selectors",
"or",
"affinity",
"rules",
"to",
"the",
"pod",
"either",
"set",
"in",
"the",
"workflow",
"or",
"the",
"template"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/workflowpod.go#L449-L493 | train |
argoproj/argo | workflow/controller/workflowpod.go | addArchiveLocation | func (woc *wfOperationCtx) addArchiveLocation(pod *apiv1.Pod, tmpl *wfv1.Template) error {
// needLocation keeps track if the workflow needs to have an archive location set.
// If so, and one was not supplied (or defaulted), we will return error
var needLocation bool
if tmpl.ArchiveLocation != nil {
if tmpl.Arch... | go | func (woc *wfOperationCtx) addArchiveLocation(pod *apiv1.Pod, tmpl *wfv1.Template) error {
// needLocation keeps track if the workflow needs to have an archive location set.
// If so, and one was not supplied (or defaulted), we will return error
var needLocation bool
if tmpl.ArchiveLocation != nil {
if tmpl.Arch... | [
"func",
"(",
"woc",
"*",
"wfOperationCtx",
")",
"addArchiveLocation",
"(",
"pod",
"*",
"apiv1",
".",
"Pod",
",",
"tmpl",
"*",
"wfv1",
".",
"Template",
")",
"error",
"{",
"// needLocation keeps track if the workflow needs to have an archive location set.",
"// If so, and... | // addArchiveLocation conditionally updates the template with the default artifact repository
// information configured in the controller, for the purposes of archiving outputs. This is skipped
// for templates which do not need to archive anything, or have explicitly set an archive location
// in the template. | [
"addArchiveLocation",
"conditionally",
"updates",
"the",
"template",
"with",
"the",
"default",
"artifact",
"repository",
"information",
"configured",
"in",
"the",
"controller",
"for",
"the",
"purposes",
"of",
"archiving",
"outputs",
".",
"This",
"is",
"skipped",
"fo... | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/workflowpod.go#L709-L772 | train |
argoproj/argo | workflow/controller/workflowpod.go | addScriptStagingVolume | func addScriptStagingVolume(pod *apiv1.Pod) {
volName := "argo-staging"
stagingVol := apiv1.Volume{
Name: volName,
VolumeSource: apiv1.VolumeSource{
EmptyDir: &apiv1.EmptyDirVolumeSource{},
},
}
pod.Spec.Volumes = append(pod.Spec.Volumes, stagingVol)
for i, initCtr := range pod.Spec.InitContainers {
if... | go | func addScriptStagingVolume(pod *apiv1.Pod) {
volName := "argo-staging"
stagingVol := apiv1.Volume{
Name: volName,
VolumeSource: apiv1.VolumeSource{
EmptyDir: &apiv1.EmptyDirVolumeSource{},
},
}
pod.Spec.Volumes = append(pod.Spec.Volumes, stagingVol)
for i, initCtr := range pod.Spec.InitContainers {
if... | [
"func",
"addScriptStagingVolume",
"(",
"pod",
"*",
"apiv1",
".",
"Pod",
")",
"{",
"volName",
":=",
"\"",
"\"",
"\n",
"stagingVol",
":=",
"apiv1",
".",
"Volume",
"{",
"Name",
":",
"volName",
",",
"VolumeSource",
":",
"apiv1",
".",
"VolumeSource",
"{",
"Em... | // addScriptStagingVolume sets up a shared staging volume between the init container
// and main container for the purpose of holding the script source code for script templates | [
"addScriptStagingVolume",
"sets",
"up",
"a",
"shared",
"staging",
"volume",
"between",
"the",
"init",
"container",
"and",
"main",
"container",
"for",
"the",
"purpose",
"of",
"holding",
"the",
"script",
"source",
"code",
"for",
"script",
"templates"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/workflowpod.go#L776-L813 | train |
argoproj/argo | workflow/controller/workflowpod.go | addInitContainers | func addInitContainers(pod *apiv1.Pod, tmpl *wfv1.Template) error {
if len(tmpl.InitContainers) == 0 {
return nil
}
mainCtr := findMainContainer(pod)
if mainCtr == nil {
panic("Unable to locate main container")
}
for _, ctr := range tmpl.InitContainers {
log.Debugf("Adding init container %s", ctr.Name)
if... | go | func addInitContainers(pod *apiv1.Pod, tmpl *wfv1.Template) error {
if len(tmpl.InitContainers) == 0 {
return nil
}
mainCtr := findMainContainer(pod)
if mainCtr == nil {
panic("Unable to locate main container")
}
for _, ctr := range tmpl.InitContainers {
log.Debugf("Adding init container %s", ctr.Name)
if... | [
"func",
"addInitContainers",
"(",
"pod",
"*",
"apiv1",
".",
"Pod",
",",
"tmpl",
"*",
"wfv1",
".",
"Template",
")",
"error",
"{",
"if",
"len",
"(",
"tmpl",
".",
"InitContainers",
")",
"==",
"0",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"mainCtr",
":=",
... | // addInitContainers adds all init containers to the pod spec of the step
// Optionally volume mounts from the main container to the init containers | [
"addInitContainers",
"adds",
"all",
"init",
"containers",
"to",
"the",
"pod",
"spec",
"of",
"the",
"step",
"Optionally",
"volume",
"mounts",
"from",
"the",
"main",
"container",
"to",
"the",
"init",
"containers"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/workflowpod.go#L817-L833 | train |
argoproj/argo | workflow/controller/workflowpod.go | addSidecars | func addSidecars(pod *apiv1.Pod, tmpl *wfv1.Template) error {
if len(tmpl.Sidecars) == 0 {
return nil
}
mainCtr := findMainContainer(pod)
if mainCtr == nil {
panic("Unable to locate main container")
}
for _, sidecar := range tmpl.Sidecars {
log.Debugf("Adding sidecar container %s", sidecar.Name)
if sideca... | go | func addSidecars(pod *apiv1.Pod, tmpl *wfv1.Template) error {
if len(tmpl.Sidecars) == 0 {
return nil
}
mainCtr := findMainContainer(pod)
if mainCtr == nil {
panic("Unable to locate main container")
}
for _, sidecar := range tmpl.Sidecars {
log.Debugf("Adding sidecar container %s", sidecar.Name)
if sideca... | [
"func",
"addSidecars",
"(",
"pod",
"*",
"apiv1",
".",
"Pod",
",",
"tmpl",
"*",
"wfv1",
".",
"Template",
")",
"error",
"{",
"if",
"len",
"(",
"tmpl",
".",
"Sidecars",
")",
"==",
"0",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"mainCtr",
":=",
"findMainC... | // addSidecars adds all sidecars to the pod spec of the step.
// Optionally volume mounts from the main container to the sidecar | [
"addSidecars",
"adds",
"all",
"sidecars",
"to",
"the",
"pod",
"spec",
"of",
"the",
"step",
".",
"Optionally",
"volume",
"mounts",
"from",
"the",
"main",
"container",
"to",
"the",
"sidecar"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/workflowpod.go#L837-L853 | train |
argoproj/argo | workflow/controller/workflowpod.go | createSecretVolumes | func createSecretVolumes(tmpl *wfv1.Template) ([]apiv1.Volume, []apiv1.VolumeMount) {
var allVolumesMap = make(map[string]apiv1.Volume)
var uniqueKeyMap = make(map[string]bool)
var secretVolumes []apiv1.Volume
var secretVolMounts []apiv1.VolumeMount
createArchiveLocationSecret(tmpl, allVolumesMap, uniqueKeyMap)
... | go | func createSecretVolumes(tmpl *wfv1.Template) ([]apiv1.Volume, []apiv1.VolumeMount) {
var allVolumesMap = make(map[string]apiv1.Volume)
var uniqueKeyMap = make(map[string]bool)
var secretVolumes []apiv1.Volume
var secretVolMounts []apiv1.VolumeMount
createArchiveLocationSecret(tmpl, allVolumesMap, uniqueKeyMap)
... | [
"func",
"createSecretVolumes",
"(",
"tmpl",
"*",
"wfv1",
".",
"Template",
")",
"(",
"[",
"]",
"apiv1",
".",
"Volume",
",",
"[",
"]",
"apiv1",
".",
"VolumeMount",
")",
"{",
"var",
"allVolumesMap",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"apiv1",
... | // createSecretVolumes will retrieve and create Volumes and Volumemount object for Pod | [
"createSecretVolumes",
"will",
"retrieve",
"and",
"create",
"Volumes",
"and",
"Volumemount",
"object",
"for",
"Pod"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/workflowpod.go#L871-L896 | train |
argoproj/argo | workflow/controller/workflowpod.go | findMainContainer | func findMainContainer(pod *apiv1.Pod) *apiv1.Container {
var mainCtr *apiv1.Container
for _, ctr := range pod.Spec.Containers {
if ctr.Name != common.MainContainerName {
continue
}
mainCtr = &ctr
break
}
return mainCtr
} | go | func findMainContainer(pod *apiv1.Pod) *apiv1.Container {
var mainCtr *apiv1.Container
for _, ctr := range pod.Spec.Containers {
if ctr.Name != common.MainContainerName {
continue
}
mainCtr = &ctr
break
}
return mainCtr
} | [
"func",
"findMainContainer",
"(",
"pod",
"*",
"apiv1",
".",
"Pod",
")",
"*",
"apiv1",
".",
"Container",
"{",
"var",
"mainCtr",
"*",
"apiv1",
".",
"Container",
"\n",
"for",
"_",
",",
"ctr",
":=",
"range",
"pod",
".",
"Spec",
".",
"Containers",
"{",
"i... | // findMainContainer finds main container | [
"findMainContainer",
"finds",
"main",
"container"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/workflowpod.go#L969-L979 | train |
argoproj/argo | workflow/controller/workflowpod.go | mirrorVolumeMounts | func mirrorVolumeMounts(sourceContainer, targetContainer *apiv1.Container) {
for _, volMnt := range sourceContainer.VolumeMounts {
if targetContainer.VolumeMounts == nil {
targetContainer.VolumeMounts = make([]apiv1.VolumeMount, 0)
}
log.Debugf("Adding volume mount %v to container %v", volMnt.Name, targetCont... | go | func mirrorVolumeMounts(sourceContainer, targetContainer *apiv1.Container) {
for _, volMnt := range sourceContainer.VolumeMounts {
if targetContainer.VolumeMounts == nil {
targetContainer.VolumeMounts = make([]apiv1.VolumeMount, 0)
}
log.Debugf("Adding volume mount %v to container %v", volMnt.Name, targetCont... | [
"func",
"mirrorVolumeMounts",
"(",
"sourceContainer",
",",
"targetContainer",
"*",
"apiv1",
".",
"Container",
")",
"{",
"for",
"_",
",",
"volMnt",
":=",
"range",
"sourceContainer",
".",
"VolumeMounts",
"{",
"if",
"targetContainer",
".",
"VolumeMounts",
"==",
"ni... | // mirrorVolumeMounts mirrors volumeMounts of source container to target container | [
"mirrorVolumeMounts",
"mirrors",
"volumeMounts",
"of",
"source",
"container",
"to",
"target",
"container"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/workflowpod.go#L982-L991 | train |
argoproj/argo | pkg/client/clientset/versioned/typed/workflow/v1alpha1/workflow.go | newWorkflows | func newWorkflows(c *ArgoprojV1alpha1Client, namespace string) *workflows {
return &workflows{
client: c.RESTClient(),
ns: namespace,
}
} | go | func newWorkflows(c *ArgoprojV1alpha1Client, namespace string) *workflows {
return &workflows{
client: c.RESTClient(),
ns: namespace,
}
} | [
"func",
"newWorkflows",
"(",
"c",
"*",
"ArgoprojV1alpha1Client",
",",
"namespace",
"string",
")",
"*",
"workflows",
"{",
"return",
"&",
"workflows",
"{",
"client",
":",
"c",
".",
"RESTClient",
"(",
")",
",",
"ns",
":",
"namespace",
",",
"}",
"\n",
"}"
] | // newWorkflows returns a Workflows | [
"newWorkflows",
"returns",
"a",
"Workflows"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/client/clientset/versioned/typed/workflow/v1alpha1/workflow.go#L40-L45 | train |
argoproj/argo | cmd/argo/commands/wait.go | WaitWorkflows | func WaitWorkflows(workflowNames []string, ignoreNotFound, quiet bool) {
var wg sync.WaitGroup
for _, workflowName := range workflowNames {
wg.Add(1)
go func(name string) {
waitOnOne(name, ignoreNotFound, quiet)
wg.Done()
}(workflowName)
}
wg.Wait()
} | go | func WaitWorkflows(workflowNames []string, ignoreNotFound, quiet bool) {
var wg sync.WaitGroup
for _, workflowName := range workflowNames {
wg.Add(1)
go func(name string) {
waitOnOne(name, ignoreNotFound, quiet)
wg.Done()
}(workflowName)
}
wg.Wait()
} | [
"func",
"WaitWorkflows",
"(",
"workflowNames",
"[",
"]",
"string",
",",
"ignoreNotFound",
",",
"quiet",
"bool",
")",
"{",
"var",
"wg",
"sync",
".",
"WaitGroup",
"\n",
"for",
"_",
",",
"workflowName",
":=",
"range",
"workflowNames",
"{",
"wg",
".",
"Add",
... | // WaitWorkflows waits for the given workflowNames. | [
"WaitWorkflows",
"waits",
"for",
"the",
"given",
"workflowNames",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/cmd/argo/commands/wait.go#L37-L47 | train |
argoproj/argo | cmd/argo/commands/submit.go | unmarshalWorkflows | func unmarshalWorkflows(wfBytes []byte, strict bool) []wfv1.Workflow {
var wf wfv1.Workflow
var jsonOpts []json.JSONOpt
if strict {
jsonOpts = append(jsonOpts, json.DisallowUnknownFields)
}
err := json.Unmarshal(wfBytes, &wf, jsonOpts...)
if err == nil {
return []wfv1.Workflow{wf}
}
yamlWfs, err := common.S... | go | func unmarshalWorkflows(wfBytes []byte, strict bool) []wfv1.Workflow {
var wf wfv1.Workflow
var jsonOpts []json.JSONOpt
if strict {
jsonOpts = append(jsonOpts, json.DisallowUnknownFields)
}
err := json.Unmarshal(wfBytes, &wf, jsonOpts...)
if err == nil {
return []wfv1.Workflow{wf}
}
yamlWfs, err := common.S... | [
"func",
"unmarshalWorkflows",
"(",
"wfBytes",
"[",
"]",
"byte",
",",
"strict",
"bool",
")",
"[",
"]",
"wfv1",
".",
"Workflow",
"{",
"var",
"wf",
"wfv1",
".",
"Workflow",
"\n",
"var",
"jsonOpts",
"[",
"]",
"json",
".",
"JSONOpt",
"\n",
"if",
"strict",
... | // unmarshalWorkflows unmarshals the input bytes as either json or yaml | [
"unmarshalWorkflows",
"unmarshals",
"the",
"input",
"bytes",
"as",
"either",
"json",
"or",
"yaml"
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/cmd/argo/commands/submit.go#L128-L144 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *ArchiveStrategy) DeepCopy() *ArchiveStrategy {
if in == nil {
return nil
}
out := new(ArchiveStrategy)
in.DeepCopyInto(out)
return out
} | go | func (in *ArchiveStrategy) DeepCopy() *ArchiveStrategy {
if in == nil {
return nil
}
out := new(ArchiveStrategy)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"ArchiveStrategy",
")",
"DeepCopy",
"(",
")",
"*",
"ArchiveStrategy",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"ArchiveStrategy",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArchiveStrategy. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"ArchiveStrategy",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L29-L36 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *Arguments) DeepCopy() *Arguments {
if in == nil {
return nil
}
out := new(Arguments)
in.DeepCopyInto(out)
return out
} | go | func (in *Arguments) DeepCopy() *Arguments {
if in == nil {
return nil
}
out := new(Arguments)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"Arguments",
")",
"DeepCopy",
"(",
")",
"*",
"Arguments",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"Arguments",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
")",
"\... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Arguments. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"Arguments",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L59-L66 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *Artifact) DeepCopy() *Artifact {
if in == nil {
return nil
}
out := new(Artifact)
in.DeepCopyInto(out)
return out
} | go | func (in *Artifact) DeepCopy() *Artifact {
if in == nil {
return nil
}
out := new(Artifact)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"Artifact",
")",
"DeepCopy",
"(",
")",
"*",
"Artifact",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"Artifact",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
")",
"\n",... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Artifact. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"Artifact",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L86-L93 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *ArtifactLocation) DeepCopy() *ArtifactLocation {
if in == nil {
return nil
}
out := new(ArtifactLocation)
in.DeepCopyInto(out)
return out
} | go | func (in *ArtifactLocation) DeepCopy() *ArtifactLocation {
if in == nil {
return nil
}
out := new(ArtifactLocation)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"ArtifactLocation",
")",
"DeepCopy",
"(",
")",
"*",
"ArtifactLocation",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"ArtifactLocation",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArtifactLocation. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"ArtifactLocation",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L137-L144 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *ArtifactoryArtifact) DeepCopy() *ArtifactoryArtifact {
if in == nil {
return nil
}
out := new(ArtifactoryArtifact)
in.DeepCopyInto(out)
return out
} | go | func (in *ArtifactoryArtifact) DeepCopy() *ArtifactoryArtifact {
if in == nil {
return nil
}
out := new(ArtifactoryArtifact)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"ArtifactoryArtifact",
")",
"DeepCopy",
"(",
")",
"*",
"ArtifactoryArtifact",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"ArtifactoryArtifact",
")",
"\n",
"in",
".",
"DeepCopyInto... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArtifactoryArtifact. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"ArtifactoryArtifact",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L154-L161 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *ArtifactoryAuth) DeepCopy() *ArtifactoryAuth {
if in == nil {
return nil
}
out := new(ArtifactoryAuth)
in.DeepCopyInto(out)
return out
} | go | func (in *ArtifactoryAuth) DeepCopy() *ArtifactoryAuth {
if in == nil {
return nil
}
out := new(ArtifactoryAuth)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"ArtifactoryAuth",
")",
"DeepCopy",
"(",
")",
"*",
"ArtifactoryAuth",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"ArtifactoryAuth",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArtifactoryAuth. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"ArtifactoryAuth",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L180-L187 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *ContinueOn) DeepCopy() *ContinueOn {
if in == nil {
return nil
}
out := new(ContinueOn)
in.DeepCopyInto(out)
return out
} | go | func (in *ContinueOn) DeepCopy() *ContinueOn {
if in == nil {
return nil
}
out := new(ContinueOn)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"ContinueOn",
")",
"DeepCopy",
"(",
")",
"*",
"ContinueOn",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"ContinueOn",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
")",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContinueOn. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"ContinueOn",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L196-L203 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *DAGTask) DeepCopy() *DAGTask {
if in == nil {
return nil
}
out := new(DAGTask)
in.DeepCopyInto(out)
return out
} | go | func (in *DAGTask) DeepCopy() *DAGTask {
if in == nil {
return nil
}
out := new(DAGTask)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"DAGTask",
")",
"DeepCopy",
"(",
")",
"*",
"DAGTask",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"DAGTask",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
")",
"\n",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DAGTask. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"DAGTask",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L235-L242 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *DAGTemplate) DeepCopy() *DAGTemplate {
if in == nil {
return nil
}
out := new(DAGTemplate)
in.DeepCopyInto(out)
return out
} | go | func (in *DAGTemplate) DeepCopy() *DAGTemplate {
if in == nil {
return nil
}
out := new(DAGTemplate)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"DAGTemplate",
")",
"DeepCopy",
"(",
")",
"*",
"DAGTemplate",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"DAGTemplate",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
")"... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DAGTemplate. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"DAGTemplate",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L258-L265 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *GitArtifact) DeepCopy() *GitArtifact {
if in == nil {
return nil
}
out := new(GitArtifact)
in.DeepCopyInto(out)
return out
} | go | func (in *GitArtifact) DeepCopy() *GitArtifact {
if in == nil {
return nil
}
out := new(GitArtifact)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"GitArtifact",
")",
"DeepCopy",
"(",
")",
"*",
"GitArtifact",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"GitArtifact",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
")"... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitArtifact. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"GitArtifact",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L289-L296 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *HDFSArtifact) DeepCopy() *HDFSArtifact {
if in == nil {
return nil
}
out := new(HDFSArtifact)
in.DeepCopyInto(out)
return out
} | go | func (in *HDFSArtifact) DeepCopy() *HDFSArtifact {
if in == nil {
return nil
}
out := new(HDFSArtifact)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"HDFSArtifact",
")",
"DeepCopy",
"(",
")",
"*",
"HDFSArtifact",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"HDFSArtifact",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HDFSArtifact. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"HDFSArtifact",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L306-L313 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *HDFSConfig) DeepCopy() *HDFSConfig {
if in == nil {
return nil
}
out := new(HDFSConfig)
in.DeepCopyInto(out)
return out
} | go | func (in *HDFSConfig) DeepCopy() *HDFSConfig {
if in == nil {
return nil
}
out := new(HDFSConfig)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"HDFSConfig",
")",
"DeepCopy",
"(",
")",
"*",
"HDFSConfig",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"HDFSConfig",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
")",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HDFSConfig. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"HDFSConfig",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L328-L335 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *HDFSKrbConfig) DeepCopy() *HDFSKrbConfig {
if in == nil {
return nil
}
out := new(HDFSKrbConfig)
in.DeepCopyInto(out)
return out
} | go | func (in *HDFSKrbConfig) DeepCopy() *HDFSKrbConfig {
if in == nil {
return nil
}
out := new(HDFSKrbConfig)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"HDFSKrbConfig",
")",
"DeepCopy",
"(",
")",
"*",
"HDFSKrbConfig",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"HDFSKrbConfig",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HDFSKrbConfig. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"HDFSKrbConfig",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L359-L366 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *HTTPArtifact) DeepCopy() *HTTPArtifact {
if in == nil {
return nil
}
out := new(HTTPArtifact)
in.DeepCopyInto(out)
return out
} | go | func (in *HTTPArtifact) DeepCopy() *HTTPArtifact {
if in == nil {
return nil
}
out := new(HTTPArtifact)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"HTTPArtifact",
")",
"DeepCopy",
"(",
")",
"*",
"HTTPArtifact",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"HTTPArtifact",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPArtifact. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"HTTPArtifact",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L375-L382 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *Inputs) DeepCopy() *Inputs {
if in == nil {
return nil
}
out := new(Inputs)
in.DeepCopyInto(out)
return out
} | go | func (in *Inputs) DeepCopy() *Inputs {
if in == nil {
return nil
}
out := new(Inputs)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"Inputs",
")",
"DeepCopy",
"(",
")",
"*",
"Inputs",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"Inputs",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
")",
"\n",
"re... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Inputs. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"Inputs",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L405-L412 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *Item) DeepCopy() *Item {
if in == nil {
return nil
}
out := new(Item)
in.DeepCopyInto(out)
return out
} | go | func (in *Item) DeepCopy() *Item {
if in == nil {
return nil
}
out := new(Item)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"Item",
")",
"DeepCopy",
"(",
")",
"*",
"Item",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"Item",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
")",
"\n",
"return",... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Item. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"Item",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L415-L422 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *Metadata) DeepCopy() *Metadata {
if in == nil {
return nil
}
out := new(Metadata)
in.DeepCopyInto(out)
return out
} | go | func (in *Metadata) DeepCopy() *Metadata {
if in == nil {
return nil
}
out := new(Metadata)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"Metadata",
")",
"DeepCopy",
"(",
")",
"*",
"Metadata",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"Metadata",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
")",
"\n",... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Metadata. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"Metadata",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L445-L452 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *NoneStrategy) DeepCopy() *NoneStrategy {
if in == nil {
return nil
}
out := new(NoneStrategy)
in.DeepCopyInto(out)
return out
} | go | func (in *NoneStrategy) DeepCopy() *NoneStrategy {
if in == nil {
return nil
}
out := new(NoneStrategy)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"NoneStrategy",
")",
"DeepCopy",
"(",
")",
"*",
"NoneStrategy",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"NoneStrategy",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NoneStrategy. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"NoneStrategy",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L504-L511 | train |
argoproj/argo | pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go | DeepCopy | func (in *Outputs) DeepCopy() *Outputs {
if in == nil {
return nil
}
out := new(Outputs)
in.DeepCopyInto(out)
return out
} | go | func (in *Outputs) DeepCopy() *Outputs {
if in == nil {
return nil
}
out := new(Outputs)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"Outputs",
")",
"DeepCopy",
"(",
")",
"*",
"Outputs",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"Outputs",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
")",
"\n",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Outputs. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"Outputs",
"."
] | 4e37a444bde2a034885d0db35f7b38684505063e | https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L539-L546 | train |
Subsets and Splits
SQL Console for semeru/code-text-go
Retrieves a limited set of code samples with their languages, with a specific case adjustment for 'Go' language.