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
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
DeepCopy
func (in *RawArtifact) DeepCopy() *RawArtifact { if in == nil { return nil } out := new(RawArtifact) in.DeepCopyInto(out) return out }
go
func (in *RawArtifact) DeepCopy() *RawArtifact { if in == nil { return nil } out := new(RawArtifact) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "RawArtifact", ")", "DeepCopy", "(", ")", "*", "RawArtifact", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "RawArtifact", ")", "\n", "in", ".", "DeepCopyInto", "(", "out", ")"...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RawArtifact.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "RawArtifact", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L586-L593
train
argoproj/argo
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
DeepCopy
func (in *ResourceTemplate) DeepCopy() *ResourceTemplate { if in == nil { return nil } out := new(ResourceTemplate) in.DeepCopyInto(out) return out }
go
func (in *ResourceTemplate) DeepCopy() *ResourceTemplate { if in == nil { return nil } out := new(ResourceTemplate) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "ResourceTemplate", ")", "DeepCopy", "(", ")", "*", "ResourceTemplate", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "ResourceTemplate", ")", "\n", "in", ".", "DeepCopyInto", "(",...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceTemplate.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "ResourceTemplate", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L602-L609
train
argoproj/argo
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
DeepCopy
func (in *RetryStrategy) DeepCopy() *RetryStrategy { if in == nil { return nil } out := new(RetryStrategy) in.DeepCopyInto(out) return out }
go
func (in *RetryStrategy) DeepCopy() *RetryStrategy { if in == nil { return nil } out := new(RetryStrategy) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "RetryStrategy", ")", "DeepCopy", "(", ")", "*", "RetryStrategy", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "RetryStrategy", ")", "\n", "in", ".", "DeepCopyInto", "(", "out",...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetryStrategy.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "RetryStrategy", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L623-L630
train
argoproj/argo
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
DeepCopy
func (in *S3Artifact) DeepCopy() *S3Artifact { if in == nil { return nil } out := new(S3Artifact) in.DeepCopyInto(out) return out }
go
func (in *S3Artifact) DeepCopy() *S3Artifact { if in == nil { return nil } out := new(S3Artifact) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "S3Artifact", ")", "DeepCopy", "(", ")", "*", "S3Artifact", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "S3Artifact", ")", "\n", "in", ".", "DeepCopyInto", "(", "out", ")", ...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3Artifact.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "S3Artifact", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L640-L647
train
argoproj/argo
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
DeepCopy
func (in *S3Bucket) DeepCopy() *S3Bucket { if in == nil { return nil } out := new(S3Bucket) in.DeepCopyInto(out) return out }
go
func (in *S3Bucket) DeepCopy() *S3Bucket { if in == nil { return nil } out := new(S3Bucket) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "S3Bucket", ")", "DeepCopy", "(", ")", "*", "S3Bucket", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "S3Bucket", ")", "\n", "in", ".", "DeepCopyInto", "(", "out", ")", "\n",...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3Bucket.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "S3Bucket", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L663-L670
train
argoproj/argo
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
DeepCopy
func (in *ScriptTemplate) DeepCopy() *ScriptTemplate { if in == nil { return nil } out := new(ScriptTemplate) in.DeepCopyInto(out) return out }
go
func (in *ScriptTemplate) DeepCopy() *ScriptTemplate { if in == nil { return nil } out := new(ScriptTemplate) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "ScriptTemplate", ")", "DeepCopy", "(", ")", "*", "ScriptTemplate", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "ScriptTemplate", ")", "\n", "in", ".", "DeepCopyInto", "(", "ou...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScriptTemplate.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "ScriptTemplate", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L680-L687
train
argoproj/argo
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
DeepCopy
func (in *Sequence) DeepCopy() *Sequence { if in == nil { return nil } out := new(Sequence) in.DeepCopyInto(out) return out }
go
func (in *Sequence) DeepCopy() *Sequence { if in == nil { return nil } out := new(Sequence) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "Sequence", ")", "DeepCopy", "(", ")", "*", "Sequence", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "Sequence", ")", "\n", "in", ".", "DeepCopyInto", "(", "out", ")", "\n",...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sequence.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "Sequence", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L696-L703
train
argoproj/argo
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
DeepCopy
func (in *SuspendTemplate) DeepCopy() *SuspendTemplate { if in == nil { return nil } out := new(SuspendTemplate) in.DeepCopyInto(out) return out }
go
func (in *SuspendTemplate) DeepCopy() *SuspendTemplate { if in == nil { return nil } out := new(SuspendTemplate) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "SuspendTemplate", ")", "DeepCopy", "(", ")", "*", "SuspendTemplate", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "SuspendTemplate", ")", "\n", "in", ".", "DeepCopyInto", "(", ...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SuspendTemplate.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "SuspendTemplate", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L712-L719
train
argoproj/argo
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
DeepCopy
func (in *TarStrategy) DeepCopy() *TarStrategy { if in == nil { return nil } out := new(TarStrategy) in.DeepCopyInto(out) return out }
go
func (in *TarStrategy) DeepCopy() *TarStrategy { if in == nil { return nil } out := new(TarStrategy) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "TarStrategy", ")", "DeepCopy", "(", ")", "*", "TarStrategy", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "TarStrategy", ")", "\n", "in", ".", "DeepCopyInto", "(", "out", ")"...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TarStrategy.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "TarStrategy", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L728-L735
train
argoproj/argo
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
DeepCopy
func (in *UserContainer) DeepCopy() *UserContainer { if in == nil { return nil } out := new(UserContainer) in.DeepCopyInto(out) return out }
go
func (in *UserContainer) DeepCopy() *UserContainer { if in == nil { return nil } out := new(UserContainer) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "UserContainer", ")", "DeepCopy", "(", ")", "*", "UserContainer", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "UserContainer", ")", "\n", "in", ".", "DeepCopyInto", "(", "out",...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserContainer.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "UserContainer", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L877-L884
train
argoproj/argo
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
DeepCopy
func (in *ValueFrom) DeepCopy() *ValueFrom { if in == nil { return nil } out := new(ValueFrom) in.DeepCopyInto(out) return out }
go
func (in *ValueFrom) DeepCopy() *ValueFrom { if in == nil { return nil } out := new(ValueFrom) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "ValueFrom", ")", "DeepCopy", "(", ")", "*", "ValueFrom", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "ValueFrom", ")", "\n", "in", ".", "DeepCopyInto", "(", "out", ")", "\...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValueFrom.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "ValueFrom", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L893-L900
train
argoproj/argo
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
DeepCopy
func (in *Workflow) DeepCopy() *Workflow { if in == nil { return nil } out := new(Workflow) in.DeepCopyInto(out) return out }
go
func (in *Workflow) DeepCopy() *Workflow { if in == nil { return nil } out := new(Workflow) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "Workflow", ")", "DeepCopy", "(", ")", "*", "Workflow", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "Workflow", ")", "\n", "in", ".", "DeepCopyInto", "(", "out", ")", "\n",...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workflow.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "Workflow", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L913-L920
train
argoproj/argo
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
DeepCopy
func (in *WorkflowList) DeepCopy() *WorkflowList { if in == nil { return nil } out := new(WorkflowList) in.DeepCopyInto(out) return out }
go
func (in *WorkflowList) DeepCopy() *WorkflowList { if in == nil { return nil } out := new(WorkflowList) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "WorkflowList", ")", "DeepCopy", "(", ")", "*", "WorkflowList", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "WorkflowList", ")", "\n", "in", ".", "DeepCopyInto", "(", "out", ...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowList.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "WorkflowList", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L946-L953
train
argoproj/argo
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
DeepCopy
func (in *WorkflowSpec) DeepCopy() *WorkflowSpec { if in == nil { return nil } out := new(WorkflowSpec) in.DeepCopyInto(out) return out }
go
func (in *WorkflowSpec) DeepCopy() *WorkflowSpec { if in == nil { return nil } out := new(WorkflowSpec) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "WorkflowSpec", ")", "DeepCopy", "(", ")", "*", "WorkflowSpec", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "WorkflowSpec", ")", "\n", "in", ".", "DeepCopyInto", "(", "out", ...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowSpec.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "WorkflowSpec", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L1061-L1068
train
argoproj/argo
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
DeepCopy
func (in *WorkflowStatus) DeepCopy() *WorkflowStatus { if in == nil { return nil } out := new(WorkflowStatus) in.DeepCopyInto(out) return out }
go
func (in *WorkflowStatus) DeepCopy() *WorkflowStatus { if in == nil { return nil } out := new(WorkflowStatus) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "WorkflowStatus", ")", "DeepCopy", "(", ")", "*", "WorkflowStatus", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "WorkflowStatus", ")", "\n", "in", ".", "DeepCopyInto", "(", "ou...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStatus.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "WorkflowStatus", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L1098-L1105
train
argoproj/argo
pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go
DeepCopy
func (in *WorkflowStep) DeepCopy() *WorkflowStep { if in == nil { return nil } out := new(WorkflowStep) in.DeepCopyInto(out) return out }
go
func (in *WorkflowStep) DeepCopy() *WorkflowStep { if in == nil { return nil } out := new(WorkflowStep) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "WorkflowStep", ")", "DeepCopy", "(", ")", "*", "WorkflowStep", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "WorkflowStep", ")", "\n", "in", ".", "DeepCopyInto", "(", "out", ...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStep.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "WorkflowStep", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go#L1132-L1139
train
argoproj/argo
workflow/executor/resource.go
ExecResource
func (we *WorkflowExecutor) ExecResource(action string, manifestPath string, isDelete bool) (string, string, error) { args := []string{ action, } output := "json" if isDelete { args = append(args, "--ignore-not-found") output = "name" } if action == "patch" { mergeStrategy := "strategic" if we.Template...
go
func (we *WorkflowExecutor) ExecResource(action string, manifestPath string, isDelete bool) (string, string, error) { args := []string{ action, } output := "json" if isDelete { args = append(args, "--ignore-not-found") output = "name" } if action == "patch" { mergeStrategy := "strategic" if we.Template...
[ "func", "(", "we", "*", "WorkflowExecutor", ")", "ExecResource", "(", "action", "string", ",", "manifestPath", "string", ",", "isDelete", "bool", ")", "(", "string", ",", "string", ",", "error", ")", "{", "args", ":=", "[", "]", "string", "{", "action", ...
// ExecResource will run kubectl action against a manifest
[ "ExecResource", "will", "run", "kubectl", "action", "against", "a", "manifest" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/resource.go#L23-L75
train
argoproj/argo
workflow/executor/resource.go
Has
func (g gjsonLabels) Has(label string) bool { return gjson.GetBytes(g.json, label).Exists() }
go
func (g gjsonLabels) Has(label string) bool { return gjson.GetBytes(g.json, label).Exists() }
[ "func", "(", "g", "gjsonLabels", ")", "Has", "(", "label", "string", ")", "bool", "{", "return", "gjson", ".", "GetBytes", "(", "g", ".", "json", ",", "label", ")", ".", "Exists", "(", ")", "\n", "}" ]
// Has returns whether the provided label exists.
[ "Has", "returns", "whether", "the", "provided", "label", "exists", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/resource.go#L85-L87
train
argoproj/argo
workflow/executor/resource.go
Get
func (g gjsonLabels) Get(label string) string { return gjson.GetBytes(g.json, label).String() }
go
func (g gjsonLabels) Get(label string) string { return gjson.GetBytes(g.json, label).String() }
[ "func", "(", "g", "gjsonLabels", ")", "Get", "(", "label", "string", ")", "string", "{", "return", "gjson", ".", "GetBytes", "(", "g", ".", "json", ",", "label", ")", ".", "String", "(", ")", "\n", "}" ]
// Get returns the value for the provided label.
[ "Get", "returns", "the", "value", "for", "the", "provided", "label", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/resource.go#L90-L92
train
argoproj/argo
workflow/executor/resource.go
WaitResource
func (we *WorkflowExecutor) WaitResource(resourceNamespace string, resourceName string) error { if we.Template.Resource.SuccessCondition == "" && we.Template.Resource.FailureCondition == "" { return nil } var successReqs labels.Requirements if we.Template.Resource.SuccessCondition != "" { successSelector, err :...
go
func (we *WorkflowExecutor) WaitResource(resourceNamespace string, resourceName string) error { if we.Template.Resource.SuccessCondition == "" && we.Template.Resource.FailureCondition == "" { return nil } var successReqs labels.Requirements if we.Template.Resource.SuccessCondition != "" { successSelector, err :...
[ "func", "(", "we", "*", "WorkflowExecutor", ")", "WaitResource", "(", "resourceNamespace", "string", ",", "resourceName", "string", ")", "error", "{", "if", "we", ".", "Template", ".", "Resource", ".", "SuccessCondition", "==", "\"", "\"", "&&", "we", ".", ...
// WaitResource waits for a specific resource to satisfy either the success or failure condition
[ "WaitResource", "waits", "for", "a", "specific", "resource", "to", "satisfy", "either", "the", "success", "or", "failure", "condition" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/resource.go#L95-L148
train
argoproj/argo
workflow/executor/resource.go
checkResourceState
func checkResourceState(resourceNamespace string, resourceName string, successReqs labels.Requirements, failReqs labels.Requirements) (bool, error) { cmd, reader, err := startKubectlWaitCmd(resourceNamespace, resourceName) if err != nil { return false, err } defer func() { _ = cmd.Process.Kill() }() for { ...
go
func checkResourceState(resourceNamespace string, resourceName string, successReqs labels.Requirements, failReqs labels.Requirements) (bool, error) { cmd, reader, err := startKubectlWaitCmd(resourceNamespace, resourceName) if err != nil { return false, err } defer func() { _ = cmd.Process.Kill() }() for { ...
[ "func", "checkResourceState", "(", "resourceNamespace", "string", ",", "resourceName", "string", ",", "successReqs", "labels", ".", "Requirements", ",", "failReqs", "labels", ".", "Requirements", ")", "(", "bool", ",", "error", ")", "{", "cmd", ",", "reader", ...
// Function to do the kubectl get -w command and then waiting on json reading.
[ "Function", "to", "do", "the", "kubectl", "get", "-", "w", "command", "and", "then", "waiting", "on", "json", "reading", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/resource.go#L151-L213
train
argoproj/argo
workflow/executor/resource.go
startKubectlWaitCmd
func startKubectlWaitCmd(resourceNamespace string, resourceName string) (*exec.Cmd, *bufio.Reader, error) { args := []string{"get", resourceName, "-w", "-o", "json"} if resourceNamespace != "" { args = append(args, "-n", resourceNamespace) } cmd := exec.Command("kubectl", args...) stdout, err := cmd.StdoutPipe()...
go
func startKubectlWaitCmd(resourceNamespace string, resourceName string) (*exec.Cmd, *bufio.Reader, error) { args := []string{"get", resourceName, "-w", "-o", "json"} if resourceNamespace != "" { args = append(args, "-n", resourceNamespace) } cmd := exec.Command("kubectl", args...) stdout, err := cmd.StdoutPipe()...
[ "func", "startKubectlWaitCmd", "(", "resourceNamespace", "string", ",", "resourceName", "string", ")", "(", "*", "exec", ".", "Cmd", ",", "*", "bufio", ".", "Reader", ",", "error", ")", "{", "args", ":=", "[", "]", "string", "{", "\"", "\"", ",", "reso...
// Start Kubectl command Get with -w return error if unable to start command
[ "Start", "Kubectl", "command", "Get", "with", "-", "w", "return", "error", "if", "unable", "to", "start", "command" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/resource.go#L216-L233
train
argoproj/argo
workflow/executor/resource.go
readJSON
func readJSON(reader *bufio.Reader) ([]byte, error) { var buffer bytes.Buffer for { line, err := reader.ReadBytes('\n') if err != nil { return nil, err } isDelimiter := len(line) == 2 && line[0] == byte('}') line = bytes.TrimSpace(line) _, err = buffer.Write(line) if err != nil { return nil, err ...
go
func readJSON(reader *bufio.Reader) ([]byte, error) { var buffer bytes.Buffer for { line, err := reader.ReadBytes('\n') if err != nil { return nil, err } isDelimiter := len(line) == 2 && line[0] == byte('}') line = bytes.TrimSpace(line) _, err = buffer.Write(line) if err != nil { return nil, err ...
[ "func", "readJSON", "(", "reader", "*", "bufio", ".", "Reader", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "var", "buffer", "bytes", ".", "Buffer", "\n", "for", "{", "line", ",", "err", ":=", "reader", ".", "ReadBytes", "(", "'\\n'", ")", ...
// readJSON reads from a reader line-by-line until it reaches "}\n" indicating end of json
[ "readJSON", "reads", "from", "a", "reader", "line", "-", "by", "-", "line", "until", "it", "reaches", "}", "\\", "n", "indicating", "end", "of", "json" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/resource.go#L236-L254
train
argoproj/argo
workflow/executor/resource.go
SaveResourceParameters
func (we *WorkflowExecutor) SaveResourceParameters(resourceNamespace string, resourceName string) error { if len(we.Template.Outputs.Parameters) == 0 { log.Infof("No output parameters") return nil } log.Infof("Saving resource output parameters") for i, param := range we.Template.Outputs.Parameters { if param....
go
func (we *WorkflowExecutor) SaveResourceParameters(resourceNamespace string, resourceName string) error { if len(we.Template.Outputs.Parameters) == 0 { log.Infof("No output parameters") return nil } log.Infof("Saving resource output parameters") for i, param := range we.Template.Outputs.Parameters { if param....
[ "func", "(", "we", "*", "WorkflowExecutor", ")", "SaveResourceParameters", "(", "resourceNamespace", "string", ",", "resourceName", "string", ")", "error", "{", "if", "len", "(", "we", ".", "Template", ".", "Outputs", ".", "Parameters", ")", "==", "0", "{", ...
// SaveResourceParameters will save any resource output parameters
[ "SaveResourceParameters", "will", "save", "any", "resource", "output", "parameters" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/resource.go#L257-L301
train
argoproj/argo
util/retry/retry.go
IsRetryableKubeAPIError
func IsRetryableKubeAPIError(err error) bool { // get original error if it was wrapped err = argoerrs.Cause(err) if apierr.IsNotFound(err) || apierr.IsForbidden(err) || apierr.IsInvalid(err) || apierr.IsMethodNotSupported(err) { return false } return true }
go
func IsRetryableKubeAPIError(err error) bool { // get original error if it was wrapped err = argoerrs.Cause(err) if apierr.IsNotFound(err) || apierr.IsForbidden(err) || apierr.IsInvalid(err) || apierr.IsMethodNotSupported(err) { return false } return true }
[ "func", "IsRetryableKubeAPIError", "(", "err", "error", ")", "bool", "{", "// get original error if it was wrapped", "err", "=", "argoerrs", ".", "Cause", "(", "err", ")", "\n", "if", "apierr", ".", "IsNotFound", "(", "err", ")", "||", "apierr", ".", "IsForbid...
// IsRetryableKubeAPIError returns if the error is a retryable kubernetes error
[ "IsRetryableKubeAPIError", "returns", "if", "the", "error", "is", "a", "retryable", "kubernetes", "error" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/util/retry/retry.go#L23-L30
train
argoproj/argo
util/retry/retry.go
IsRetryableNetworkError
func IsRetryableNetworkError(err error) bool { if err == nil { return false } // get original error if it was wrapped err = argoerrs.Cause(err) errStr := err.Error() switch err.(type) { case net.Error: switch err.(type) { case *net.DNSError, *net.OpError, net.UnknownNetworkError: return true case *ur...
go
func IsRetryableNetworkError(err error) bool { if err == nil { return false } // get original error if it was wrapped err = argoerrs.Cause(err) errStr := err.Error() switch err.(type) { case net.Error: switch err.(type) { case *net.DNSError, *net.OpError, net.UnknownNetworkError: return true case *ur...
[ "func", "IsRetryableNetworkError", "(", "err", "error", ")", "bool", "{", "if", "err", "==", "nil", "{", "return", "false", "\n", "}", "\n", "// get original error if it was wrapped", "err", "=", "argoerrs", ".", "Cause", "(", "err", ")", "\n", "errStr", ":=...
// IsRetryableNetworkError returns whether or not the error is a retryable network error
[ "IsRetryableNetworkError", "returns", "whether", "or", "not", "the", "error", "is", "a", "retryable", "network", "error" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/util/retry/retry.go#L33-L66
train
argoproj/argo
workflow/controller/steps.go
updateOutboundNodes
func (woc *wfOperationCtx) updateOutboundNodes(nodeName string, tmpl *wfv1.Template) { outbound := make([]string, 0) // Find the last, initialized stepgroup node var lastSGNode *wfv1.NodeStatus for i := len(tmpl.Steps) - 1; i >= 0; i-- { sgNode := woc.getNodeByName(fmt.Sprintf("%s[%d]", nodeName, i)) if sgNode ...
go
func (woc *wfOperationCtx) updateOutboundNodes(nodeName string, tmpl *wfv1.Template) { outbound := make([]string, 0) // Find the last, initialized stepgroup node var lastSGNode *wfv1.NodeStatus for i := len(tmpl.Steps) - 1; i >= 0; i-- { sgNode := woc.getNodeByName(fmt.Sprintf("%s[%d]", nodeName, i)) if sgNode ...
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "updateOutboundNodes", "(", "nodeName", "string", ",", "tmpl", "*", "wfv1", ".", "Template", ")", "{", "outbound", ":=", "make", "(", "[", "]", "string", ",", "0", ")", "\n", "// Find the last, initialized step...
// updateOutboundNodes set the outbound nodes from the last step group
[ "updateOutboundNodes", "set", "the", "outbound", "nodes", "from", "the", "last", "step", "group" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/steps.go#L122-L148
train
argoproj/argo
workflow/controller/steps.go
shouldExecute
func shouldExecute(when string) (bool, error) { if when == "" { return true, nil } expression, err := govaluate.NewEvaluableExpression(when) if err != nil { return false, errors.Errorf(errors.CodeBadRequest, "Invalid 'when' expression '%s': %v", when, err) } // The following loop converts govaluate variables ...
go
func shouldExecute(when string) (bool, error) { if when == "" { return true, nil } expression, err := govaluate.NewEvaluableExpression(when) if err != nil { return false, errors.Errorf(errors.CodeBadRequest, "Invalid 'when' expression '%s': %v", when, err) } // The following loop converts govaluate variables ...
[ "func", "shouldExecute", "(", "when", "string", ")", "(", "bool", ",", "error", ")", "{", "if", "when", "==", "\"", "\"", "{", "return", "true", ",", "nil", "\n", "}", "\n", "expression", ",", "err", ":=", "govaluate", ".", "NewEvaluableExpression", "(...
// shouldExecute evaluates a already substituted when expression to decide whether or not a step should execute
[ "shouldExecute", "evaluates", "a", "already", "substituted", "when", "expression", "to", "decide", "whether", "or", "not", "a", "step", "should", "execute" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/steps.go#L236-L269
train
argoproj/argo
workflow/controller/steps.go
expandStep
func (woc *wfOperationCtx) expandStep(step wfv1.WorkflowStep) ([]wfv1.WorkflowStep, error) { stepBytes, err := json.Marshal(step) if err != nil { return nil, errors.InternalWrapError(err) } fstTmpl := fasttemplate.New(string(stepBytes), "{{", "}}") expandedStep := make([]wfv1.WorkflowStep, 0) var items []wfv1.I...
go
func (woc *wfOperationCtx) expandStep(step wfv1.WorkflowStep) ([]wfv1.WorkflowStep, error) { stepBytes, err := json.Marshal(step) if err != nil { return nil, errors.InternalWrapError(err) } fstTmpl := fasttemplate.New(string(stepBytes), "{{", "}}") expandedStep := make([]wfv1.WorkflowStep, 0) var items []wfv1.I...
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "expandStep", "(", "step", "wfv1", ".", "WorkflowStep", ")", "(", "[", "]", "wfv1", ".", "WorkflowStep", ",", "error", ")", "{", "stepBytes", ",", "err", ":=", "json", ".", "Marshal", "(", "step", ")", ...
// expandStep expands a step containing withItems or withParams into multiple parallel steps
[ "expandStep", "expands", "a", "step", "containing", "withItems", "or", "withParams", "into", "multiple", "parallel", "steps" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/steps.go#L343-L379
train
argoproj/argo
version.go
GetVersion
func GetVersion() Version { var versionStr string if gitCommit != "" && gitTag != "" && gitTreeState == "clean" { // if we have a clean tree state and the current commit is tagged, // this is an official release. versionStr = gitTag } else { // otherwise formulate a version string based on as much metadata ...
go
func GetVersion() Version { var versionStr string if gitCommit != "" && gitTag != "" && gitTreeState == "clean" { // if we have a clean tree state and the current commit is tagged, // this is an official release. versionStr = gitTag } else { // otherwise formulate a version string based on as much metadata ...
[ "func", "GetVersion", "(", ")", "Version", "{", "var", "versionStr", "string", "\n", "if", "gitCommit", "!=", "\"", "\"", "&&", "gitTag", "!=", "\"", "\"", "&&", "gitTreeState", "==", "\"", "\"", "{", "// if we have a clean tree state and the current commit is tag...
// GetVersion returns the version information
[ "GetVersion", "returns", "the", "version", "information" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/version.go#L35-L64
train
argoproj/argo
workflow/executor/pns/pns.go
enterChroot
func (p *PNSExecutor) enterChroot() error { if p.mainFS == nil { return errors.InternalErrorf("could not chroot into main for artifact collection: container may have exited too quickly") } if err := p.mainFS.Chdir(); err != nil { return errors.InternalWrapErrorf(err, "failed to chdir to main filesystem: %v", err...
go
func (p *PNSExecutor) enterChroot() error { if p.mainFS == nil { return errors.InternalErrorf("could not chroot into main for artifact collection: container may have exited too quickly") } if err := p.mainFS.Chdir(); err != nil { return errors.InternalWrapErrorf(err, "failed to chdir to main filesystem: %v", err...
[ "func", "(", "p", "*", "PNSExecutor", ")", "enterChroot", "(", ")", "error", "{", "if", "p", ".", "mainFS", "==", "nil", "{", "return", "errors", ".", "InternalErrorf", "(", "\"", "\"", ")", "\n", "}", "\n", "if", "err", ":=", "p", ".", "mainFS", ...
// enterChroot enters chroot of the main container
[ "enterChroot", "enters", "chroot", "of", "the", "main", "container" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/pns/pns.go#L92-L104
train
argoproj/argo
workflow/executor/pns/pns.go
exitChroot
func (p *PNSExecutor) exitChroot() error { if err := p.rootFS.Chdir(); err != nil { return errors.InternalWrapError(err) } err := syscall.Chroot(".") if err != nil { return errors.InternalWrapError(err) } return nil }
go
func (p *PNSExecutor) exitChroot() error { if err := p.rootFS.Chdir(); err != nil { return errors.InternalWrapError(err) } err := syscall.Chroot(".") if err != nil { return errors.InternalWrapError(err) } return nil }
[ "func", "(", "p", "*", "PNSExecutor", ")", "exitChroot", "(", ")", "error", "{", "if", "err", ":=", "p", ".", "rootFS", ".", "Chdir", "(", ")", ";", "err", "!=", "nil", "{", "return", "errors", ".", "InternalWrapError", "(", "err", ")", "\n", "}", ...
// exitChroot exits chroot
[ "exitChroot", "exits", "chroot" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/pns/pns.go#L107-L116
train
argoproj/argo
workflow/executor/pns/pns.go
CopyFile
func (p *PNSExecutor) CopyFile(containerID string, sourcePath string, destPath string) (err error) { destFile, err := os.Create(destPath) if err != nil { return err } defer func() { // exit chroot and close the file. preserve the original error deferErr := p.exitChroot() if err == nil && deferErr != nil { ...
go
func (p *PNSExecutor) CopyFile(containerID string, sourcePath string, destPath string) (err error) { destFile, err := os.Create(destPath) if err != nil { return err } defer func() { // exit chroot and close the file. preserve the original error deferErr := p.exitChroot() if err == nil && deferErr != nil { ...
[ "func", "(", "p", "*", "PNSExecutor", ")", "CopyFile", "(", "containerID", "string", ",", "sourcePath", "string", ",", "destPath", "string", ")", "(", "err", "error", ")", "{", "destFile", ",", "err", ":=", "os", ".", "Create", "(", "destPath", ")", "\...
// CopyFile copies a source file in a container to a local path
[ "CopyFile", "copies", "a", "source", "file", "in", "a", "container", "to", "a", "local", "path" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/pns/pns.go#L119-L147
train
argoproj/argo
workflow/executor/pns/pns.go
Kill
func (p *PNSExecutor) Kill(containerIDs []string) error { var asyncErr error wg := sync.WaitGroup{} for _, cid := range containerIDs { wg.Add(1) go func(containerID string) { err := p.killContainer(containerID) if err != nil && asyncErr != nil { asyncErr = err } wg.Done() }(cid) } wg.Wait() ...
go
func (p *PNSExecutor) Kill(containerIDs []string) error { var asyncErr error wg := sync.WaitGroup{} for _, cid := range containerIDs { wg.Add(1) go func(containerID string) { err := p.killContainer(containerID) if err != nil && asyncErr != nil { asyncErr = err } wg.Done() }(cid) } wg.Wait() ...
[ "func", "(", "p", "*", "PNSExecutor", ")", "Kill", "(", "containerIDs", "[", "]", "string", ")", "error", "{", "var", "asyncErr", "error", "\n", "wg", ":=", "sync", ".", "WaitGroup", "{", "}", "\n", "for", "_", ",", "cid", ":=", "range", "containerID...
// Kill a list of containerIDs first with a SIGTERM then with a SIGKILL after a grace period
[ "Kill", "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/pns/pns.go#L232-L247
train
argoproj/argo
workflow/executor/pns/pns.go
getContainerPID
func (p *PNSExecutor) getContainerPID(containerID string) (int, error) { pid, ok := p.ctrIDToPid[containerID] if ok { return pid, nil } p.updateCtrIDMap() pid, ok = p.ctrIDToPid[containerID] if !ok { return -1, errors.InternalErrorf("Failed to determine pid for containerID %s: container may have exited too qu...
go
func (p *PNSExecutor) getContainerPID(containerID string) (int, error) { pid, ok := p.ctrIDToPid[containerID] if ok { return pid, nil } p.updateCtrIDMap() pid, ok = p.ctrIDToPid[containerID] if !ok { return -1, errors.InternalErrorf("Failed to determine pid for containerID %s: container may have exited too qu...
[ "func", "(", "p", "*", "PNSExecutor", ")", "getContainerPID", "(", "containerID", "string", ")", "(", "int", ",", "error", ")", "{", "pid", ",", "ok", ":=", "p", ".", "ctrIDToPid", "[", "containerID", "]", "\n", "if", "ok", "{", "return", "pid", ",",...
// getContainerPID returns the pid associated with the container id. Returns error if it was unable // to be determined because no running root processes exist with that container ID
[ "getContainerPID", "returns", "the", "pid", "associated", "with", "the", "container", "id", ".", "Returns", "error", "if", "it", "was", "unable", "to", "be", "determined", "because", "no", "running", "root", "processes", "exist", "with", "that", "container", "...
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/pns/pns.go#L284-L295
train
argoproj/argo
workflow/executor/pns/pns.go
updateCtrIDMap
func (p *PNSExecutor) updateCtrIDMap() { allProcs, err := gops.Processes() if err != nil { log.Warnf("Failed to list processes: %v", err) return } for _, proc := range allProcs { pid := proc.Pid() if pid == 1 || pid == p.thisPID || proc.PPid() != 0 { // ignore the pause container, our own pid, and non-ro...
go
func (p *PNSExecutor) updateCtrIDMap() { allProcs, err := gops.Processes() if err != nil { log.Warnf("Failed to list processes: %v", err) return } for _, proc := range allProcs { pid := proc.Pid() if pid == 1 || pid == p.thisPID || proc.PPid() != 0 { // ignore the pause container, our own pid, and non-ro...
[ "func", "(", "p", "*", "PNSExecutor", ")", "updateCtrIDMap", "(", ")", "{", "allProcs", ",", "err", ":=", "gops", ".", "Processes", "(", ")", "\n", "if", "err", "!=", "nil", "{", "log", ".", "Warnf", "(", "\"", "\"", ",", "err", ")", "\n", "retur...
// updateCtrIDMap updates the mapping between container IDs to PIDs
[ "updateCtrIDMap", "updates", "the", "mapping", "between", "container", "IDs", "to", "PIDs" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/pns/pns.go#L298-L360
train
argoproj/argo
workflow/executor/pns/pns.go
parseContainerID
func parseContainerID(pid int) (string, error) { cgroupPath := fmt.Sprintf("/proc/%d/cgroup", pid) cgroupFile, err := os.OpenFile(cgroupPath, os.O_RDONLY, os.ModePerm) if err != nil { return "", errors.InternalWrapError(err) } defer func() { _ = cgroupFile.Close() }() sc := bufio.NewScanner(cgroupFile) for sc....
go
func parseContainerID(pid int) (string, error) { cgroupPath := fmt.Sprintf("/proc/%d/cgroup", pid) cgroupFile, err := os.OpenFile(cgroupPath, os.O_RDONLY, os.ModePerm) if err != nil { return "", errors.InternalWrapError(err) } defer func() { _ = cgroupFile.Close() }() sc := bufio.NewScanner(cgroupFile) for sc....
[ "func", "parseContainerID", "(", "pid", "int", ")", "(", "string", ",", "error", ")", "{", "cgroupPath", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "pid", ")", "\n", "cgroupFile", ",", "err", ":=", "os", ".", "OpenFile", "(", "cgroupPath", ",...
// parseContainerID parses the containerID of a pid
[ "parseContainerID", "parses", "the", "containerID", "of", "a", "pid" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/pns/pns.go#L363-L385
train
argoproj/argo
workflow/artifacts/s3/s3.go
newS3Client
func (s3Driver *S3ArtifactDriver) newS3Client() (argos3.S3Client, error) { opts := argos3.S3ClientOpts{ Endpoint: s3Driver.Endpoint, Region: s3Driver.Region, Secure: s3Driver.Secure, AccessKey: s3Driver.AccessKey, SecretKey: s3Driver.SecretKey, } return argos3.NewS3Client(opts) }
go
func (s3Driver *S3ArtifactDriver) newS3Client() (argos3.S3Client, error) { opts := argos3.S3ClientOpts{ Endpoint: s3Driver.Endpoint, Region: s3Driver.Region, Secure: s3Driver.Secure, AccessKey: s3Driver.AccessKey, SecretKey: s3Driver.SecretKey, } return argos3.NewS3Client(opts) }
[ "func", "(", "s3Driver", "*", "S3ArtifactDriver", ")", "newS3Client", "(", ")", "(", "argos3", ".", "S3Client", ",", "error", ")", "{", "opts", ":=", "argos3", ".", "S3ClientOpts", "{", "Endpoint", ":", "s3Driver", ".", "Endpoint", ",", "Region", ":", "s...
// newMinioClient instantiates a new minio client object.
[ "newMinioClient", "instantiates", "a", "new", "minio", "client", "object", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/artifacts/s3/s3.go#L24-L33
train
argoproj/argo
workflow/artifacts/s3/s3.go
Load
func (s3Driver *S3ArtifactDriver) Load(inputArtifact *wfv1.Artifact, path string) error { err := wait.ExponentialBackoff(wait.Backoff{Duration: time.Second * 2, Factor: 2.0, Steps: 5, Jitter: 0.1}, func() (bool, error) { log.Infof("S3 Load path: %s, key: %s", path, inputArtifact.S3.Key) s3cli, err := s3Driver....
go
func (s3Driver *S3ArtifactDriver) Load(inputArtifact *wfv1.Artifact, path string) error { err := wait.ExponentialBackoff(wait.Backoff{Duration: time.Second * 2, Factor: 2.0, Steps: 5, Jitter: 0.1}, func() (bool, error) { log.Infof("S3 Load path: %s, key: %s", path, inputArtifact.S3.Key) s3cli, err := s3Driver....
[ "func", "(", "s3Driver", "*", "S3ArtifactDriver", ")", "Load", "(", "inputArtifact", "*", "wfv1", ".", "Artifact", ",", "path", "string", ")", "error", "{", "err", ":=", "wait", ".", "ExponentialBackoff", "(", "wait", ".", "Backoff", "{", "Duration", ":", ...
// Load downloads artifacts from S3 compliant storage
[ "Load", "downloads", "artifacts", "from", "S3", "compliant", "storage" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/artifacts/s3/s3.go#L36-L72
train
argoproj/argo
workflow/artifacts/s3/s3.go
Save
func (s3Driver *S3ArtifactDriver) Save(path string, outputArtifact *wfv1.Artifact) error { err := wait.ExponentialBackoff(wait.Backoff{Duration: time.Second * 2, Factor: 2.0, Steps: 5, Jitter: 0.1}, func() (bool, error) { log.Infof("S3 Save path: %s, key: %s", path, outputArtifact.S3.Key) s3cli, err := s3Drive...
go
func (s3Driver *S3ArtifactDriver) Save(path string, outputArtifact *wfv1.Artifact) error { err := wait.ExponentialBackoff(wait.Backoff{Duration: time.Second * 2, Factor: 2.0, Steps: 5, Jitter: 0.1}, func() (bool, error) { log.Infof("S3 Save path: %s, key: %s", path, outputArtifact.S3.Key) s3cli, err := s3Drive...
[ "func", "(", "s3Driver", "*", "S3ArtifactDriver", ")", "Save", "(", "path", "string", ",", "outputArtifact", "*", "wfv1", ".", "Artifact", ")", "error", "{", "err", ":=", "wait", ".", "ExponentialBackoff", "(", "wait", ".", "Backoff", "{", "Duration", ":",...
// Save saves an artifact to S3 compliant storage
[ "Save", "saves", "an", "artifact", "to", "S3", "compliant", "storage" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/artifacts/s3/s3.go#L75-L103
train
argoproj/argo
workflow/artifacts/raw/raw.go
Load
func (a *RawArtifactDriver) Load(artifact *wfv1.Artifact, path string) error { lf, err := os.Create(path) if err != nil { return err } defer func() { _ = lf.Close() }() _, err = lf.WriteString(artifact.Raw.Data) return err }
go
func (a *RawArtifactDriver) Load(artifact *wfv1.Artifact, path string) error { lf, err := os.Create(path) if err != nil { return err } defer func() { _ = lf.Close() }() _, err = lf.WriteString(artifact.Raw.Data) return err }
[ "func", "(", "a", "*", "RawArtifactDriver", ")", "Load", "(", "artifact", "*", "wfv1", ".", "Artifact", ",", "path", "string", ")", "error", "{", "lf", ",", "err", ":=", "os", ".", "Create", "(", "path", ")", "\n", "if", "err", "!=", "nil", "{", ...
// Store raw content as artifact
[ "Store", "raw", "content", "as", "artifact" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/artifacts/raw/raw.go#L13-L24
train
argoproj/argo
cmd/argo/commands/delete.go
NewDeleteCommand
func NewDeleteCommand() *cobra.Command { var ( all bool completed bool older string ) var command = &cobra.Command{ Use: "delete WORKFLOW", Short: "delete a workflow and its associated pods", Run: func(cmd *cobra.Command, args []string) { wfClient = InitWorkflowClient() if all { de...
go
func NewDeleteCommand() *cobra.Command { var ( all bool completed bool older string ) var command = &cobra.Command{ Use: "delete WORKFLOW", Short: "delete a workflow and its associated pods", Run: func(cmd *cobra.Command, args []string) { wfClient = InitWorkflowClient() if all { de...
[ "func", "NewDeleteCommand", "(", ")", "*", "cobra", ".", "Command", "{", "var", "(", "all", "bool", "\n", "completed", "bool", "\n", "older", "string", "\n", ")", "\n\n", "var", "command", "=", "&", "cobra", ".", "Command", "{", "Use", ":", "\"", "\"...
// NewDeleteCommand returns a new instance of an `argo delete` command
[ "NewDeleteCommand", "returns", "a", "new", "instance", "of", "an", "argo", "delete", "command" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/cmd/argo/commands/delete.go#L23-L61
train
argoproj/argo
pkg/client/clientset/versioned/fake/clientset_generated.go
ArgoprojV1alpha1
func (c *Clientset) ArgoprojV1alpha1() argoprojv1alpha1.ArgoprojV1alpha1Interface { return &fakeargoprojv1alpha1.FakeArgoprojV1alpha1{Fake: &c.Fake} }
go
func (c *Clientset) ArgoprojV1alpha1() argoprojv1alpha1.ArgoprojV1alpha1Interface { return &fakeargoprojv1alpha1.FakeArgoprojV1alpha1{Fake: &c.Fake} }
[ "func", "(", "c", "*", "Clientset", ")", "ArgoprojV1alpha1", "(", ")", "argoprojv1alpha1", ".", "ArgoprojV1alpha1Interface", "{", "return", "&", "fakeargoprojv1alpha1", ".", "FakeArgoprojV1alpha1", "{", "Fake", ":", "&", "c", ".", "Fake", "}", "\n", "}" ]
// ArgoprojV1alpha1 retrieves the ArgoprojV1alpha1Client
[ "ArgoprojV1alpha1", "retrieves", "the", "ArgoprojV1alpha1Client" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/client/clientset/versioned/fake/clientset_generated.go#L59-L61
train
argoproj/argo
pkg/client/clientset/versioned/fake/clientset_generated.go
Argoproj
func (c *Clientset) Argoproj() argoprojv1alpha1.ArgoprojV1alpha1Interface { return &fakeargoprojv1alpha1.FakeArgoprojV1alpha1{Fake: &c.Fake} }
go
func (c *Clientset) Argoproj() argoprojv1alpha1.ArgoprojV1alpha1Interface { return &fakeargoprojv1alpha1.FakeArgoprojV1alpha1{Fake: &c.Fake} }
[ "func", "(", "c", "*", "Clientset", ")", "Argoproj", "(", ")", "argoprojv1alpha1", ".", "ArgoprojV1alpha1Interface", "{", "return", "&", "fakeargoprojv1alpha1", ".", "FakeArgoprojV1alpha1", "{", "Fake", ":", "&", "c", ".", "Fake", "}", "\n", "}" ]
// Argoproj retrieves the ArgoprojV1alpha1Client
[ "Argoproj", "retrieves", "the", "ArgoprojV1alpha1Client" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/client/clientset/versioned/fake/clientset_generated.go#L64-L66
train
argoproj/argo
workflow/controller/dag.go
taskNodeName
func (d *dagContext) taskNodeName(taskName string) string { return fmt.Sprintf("%s.%s", d.boundaryName, taskName) }
go
func (d *dagContext) taskNodeName(taskName string) string { return fmt.Sprintf("%s.%s", d.boundaryName, taskName) }
[ "func", "(", "d", "*", "dagContext", ")", "taskNodeName", "(", "taskName", "string", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "d", ".", "boundaryName", ",", "taskName", ")", "\n", "}" ]
// taskNodeName formulates the nodeName for a dag task
[ "taskNodeName", "formulates", "the", "nodeName", "for", "a", "dag", "task" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/dag.go#L45-L47
train
argoproj/argo
workflow/controller/dag.go
taskNodeID
func (d *dagContext) taskNodeID(taskName string) string { nodeName := d.taskNodeName(taskName) return d.wf.NodeID(nodeName) }
go
func (d *dagContext) taskNodeID(taskName string) string { nodeName := d.taskNodeName(taskName) return d.wf.NodeID(nodeName) }
[ "func", "(", "d", "*", "dagContext", ")", "taskNodeID", "(", "taskName", "string", ")", "string", "{", "nodeName", ":=", "d", ".", "taskNodeName", "(", "taskName", ")", "\n", "return", "d", ".", "wf", ".", "NodeID", "(", "nodeName", ")", "\n", "}" ]
// taskNodeID formulates the node ID for a dag task
[ "taskNodeID", "formulates", "the", "node", "ID", "for", "a", "dag", "task" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/dag.go#L50-L53
train
argoproj/argo
workflow/controller/dag.go
assessDAGPhase
func (d *dagContext) assessDAGPhase(targetTasks []string, nodes map[string]wfv1.NodeStatus) wfv1.NodePhase { // First check all our nodes to see if anything is still running. If so, then the DAG is // considered still running (even if there are failures). Remember any failures and if retry // nodes have been exhaust...
go
func (d *dagContext) assessDAGPhase(targetTasks []string, nodes map[string]wfv1.NodeStatus) wfv1.NodePhase { // First check all our nodes to see if anything is still running. If so, then the DAG is // considered still running (even if there are failures). Remember any failures and if retry // nodes have been exhaust...
[ "func", "(", "d", "*", "dagContext", ")", "assessDAGPhase", "(", "targetTasks", "[", "]", "string", ",", "nodes", "map", "[", "string", "]", "wfv1", ".", "NodeStatus", ")", "wfv1", ".", "NodePhase", "{", "// First check all our nodes to see if anything is still ru...
// assessDAGPhase assesses the overall DAG status
[ "assessDAGPhase", "assesses", "the", "overall", "DAG", "status" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/dag.go#L65-L108
train
argoproj/argo
workflow/controller/dag.go
findLeafTaskNames
func findLeafTaskNames(tasks []wfv1.DAGTask) []string { taskIsLeaf := make(map[string]bool) for _, task := range tasks { if _, ok := taskIsLeaf[task.Name]; !ok { taskIsLeaf[task.Name] = true } for _, dependency := range task.Dependencies { taskIsLeaf[dependency] = false } } leafTaskNames := make([]str...
go
func findLeafTaskNames(tasks []wfv1.DAGTask) []string { taskIsLeaf := make(map[string]bool) for _, task := range tasks { if _, ok := taskIsLeaf[task.Name]; !ok { taskIsLeaf[task.Name] = true } for _, dependency := range task.Dependencies { taskIsLeaf[dependency] = false } } leafTaskNames := make([]str...
[ "func", "findLeafTaskNames", "(", "tasks", "[", "]", "wfv1", ".", "DAGTask", ")", "[", "]", "string", "{", "taskIsLeaf", ":=", "make", "(", "map", "[", "string", "]", "bool", ")", "\n", "for", "_", ",", "task", ":=", "range", "tasks", "{", "if", "_...
// findLeafTaskNames finds the names of all tasks whom no other nodes depend on. // This list of tasks is used as the the default list of targets when dag.targets is omitted.
[ "findLeafTaskNames", "finds", "the", "names", "of", "all", "tasks", "whom", "no", "other", "nodes", "depend", "on", ".", "This", "list", "of", "tasks", "is", "used", "as", "the", "the", "default", "list", "of", "targets", "when", "dag", ".", "targets", "...
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/dag.go#L422-L439
train
argoproj/argo
workflow/controller/dag.go
expandTask
func (woc *wfOperationCtx) expandTask(task wfv1.DAGTask) ([]wfv1.DAGTask, error) { taskBytes, err := json.Marshal(task) if err != nil { return nil, errors.InternalWrapError(err) } var items []wfv1.Item if len(task.WithItems) > 0 { items = task.WithItems } else if task.WithParam != "" { err = json.Unmarshal(...
go
func (woc *wfOperationCtx) expandTask(task wfv1.DAGTask) ([]wfv1.DAGTask, error) { taskBytes, err := json.Marshal(task) if err != nil { return nil, errors.InternalWrapError(err) } var items []wfv1.Item if len(task.WithItems) > 0 { items = task.WithItems } else if task.WithParam != "" { err = json.Unmarshal(...
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "expandTask", "(", "task", "wfv1", ".", "DAGTask", ")", "(", "[", "]", "wfv1", ".", "DAGTask", ",", "error", ")", "{", "taskBytes", ",", "err", ":=", "json", ".", "Marshal", "(", "task", ")", "\n", "i...
// expandTask expands a single DAG task containing withItems, withParams, withSequence into multiple parallel tasks
[ "expandTask", "expands", "a", "single", "DAG", "task", "containing", "withItems", "withParams", "withSequence", "into", "multiple", "parallel", "tasks" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/dag.go#L442-L477
train
argoproj/argo
workflow/executor/kubelet/client.go
CreateArchive
func (k *kubeletClient) CreateArchive(containerID, sourcePath string) (*bytes.Buffer, error) { return k.getCommandOutput(containerID, fmt.Sprintf("command=tar&command=-cf&command=-&command=%s&output=1", sourcePath)) }
go
func (k *kubeletClient) CreateArchive(containerID, sourcePath string) (*bytes.Buffer, error) { return k.getCommandOutput(containerID, fmt.Sprintf("command=tar&command=-cf&command=-&command=%s&output=1", sourcePath)) }
[ "func", "(", "k", "*", "kubeletClient", ")", "CreateArchive", "(", "containerID", ",", "sourcePath", "string", ")", "(", "*", "bytes", ".", "Buffer", ",", "error", ")", "{", "return", "k", ".", "getCommandOutput", "(", "containerID", ",", "fmt", ".", "Sp...
// createArchive exec in the given containerID and create a tarball of the given sourcePath. Works with directory
[ "createArchive", "exec", "in", "the", "given", "containerID", "and", "create", "a", "tarball", "of", "the", "given", "sourcePath", ".", "Works", "with", "directory" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/executor/kubelet/client.go#L245-L247
train
argoproj/argo
pkg/client/clientset/versioned/typed/workflow/v1alpha1/fake/fake_workflow.go
Get
func (c *FakeWorkflows) Get(name string, options v1.GetOptions) (result *v1alpha1.Workflow, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(workflowsResource, c.ns, name), &v1alpha1.Workflow{}) if obj == nil { return nil, err } return obj.(*v1alpha1.Workflow), err }
go
func (c *FakeWorkflows) Get(name string, options v1.GetOptions) (result *v1alpha1.Workflow, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(workflowsResource, c.ns, name), &v1alpha1.Workflow{}) if obj == nil { return nil, err } return obj.(*v1alpha1.Workflow), err }
[ "func", "(", "c", "*", "FakeWorkflows", ")", "Get", "(", "name", "string", ",", "options", "v1", ".", "GetOptions", ")", "(", "result", "*", "v1alpha1", ".", "Workflow", ",", "err", "error", ")", "{", "obj", ",", "err", ":=", "c", ".", "Fake", ".",...
// Get takes name of the workflow, and returns the corresponding workflow object, and an error if there is any.
[ "Get", "takes", "name", "of", "the", "workflow", "and", "returns", "the", "corresponding", "workflow", "object", "and", "an", "error", "if", "there", "is", "any", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/client/clientset/versioned/typed/workflow/v1alpha1/fake/fake_workflow.go#L26-L34
train
argoproj/argo
pkg/client/clientset/versioned/typed/workflow/v1alpha1/fake/fake_workflow.go
List
func (c *FakeWorkflows) List(opts v1.ListOptions) (result *v1alpha1.WorkflowList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(workflowsResource, workflowsKind, c.ns, opts), &v1alpha1.WorkflowList{}) if obj == nil { return nil, err } label, _, _ := testing.ExtractFromListOptions(opts) if la...
go
func (c *FakeWorkflows) List(opts v1.ListOptions) (result *v1alpha1.WorkflowList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(workflowsResource, workflowsKind, c.ns, opts), &v1alpha1.WorkflowList{}) if obj == nil { return nil, err } label, _, _ := testing.ExtractFromListOptions(opts) if la...
[ "func", "(", "c", "*", "FakeWorkflows", ")", "List", "(", "opts", "v1", ".", "ListOptions", ")", "(", "result", "*", "v1alpha1", ".", "WorkflowList", ",", "err", "error", ")", "{", "obj", ",", "err", ":=", "c", ".", "Fake", ".", "Invokes", "(", "te...
// List takes label and field selectors, and returns the list of Workflows that match those selectors.
[ "List", "takes", "label", "and", "field", "selectors", "and", "returns", "the", "list", "of", "Workflows", "that", "match", "those", "selectors", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/client/clientset/versioned/typed/workflow/v1alpha1/fake/fake_workflow.go#L37-L56
train
argoproj/argo
pkg/client/clientset/versioned/typed/workflow/v1alpha1/fake/fake_workflow.go
Watch
func (c *FakeWorkflows) Watch(opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(workflowsResource, c.ns, opts)) }
go
func (c *FakeWorkflows) Watch(opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(workflowsResource, c.ns, opts)) }
[ "func", "(", "c", "*", "FakeWorkflows", ")", "Watch", "(", "opts", "v1", ".", "ListOptions", ")", "(", "watch", ".", "Interface", ",", "error", ")", "{", "return", "c", ".", "Fake", ".", "InvokesWatch", "(", "testing", ".", "NewWatchAction", "(", "work...
// Watch returns a watch.Interface that watches the requested workflows.
[ "Watch", "returns", "a", "watch", ".", "Interface", "that", "watches", "the", "requested", "workflows", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/client/clientset/versioned/typed/workflow/v1alpha1/fake/fake_workflow.go#L59-L63
train
argoproj/argo
pkg/client/clientset/versioned/typed/workflow/v1alpha1/fake/fake_workflow.go
Delete
func (c *FakeWorkflows) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(workflowsResource, c.ns, name), &v1alpha1.Workflow{}) return err }
go
func (c *FakeWorkflows) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(workflowsResource, c.ns, name), &v1alpha1.Workflow{}) return err }
[ "func", "(", "c", "*", "FakeWorkflows", ")", "Delete", "(", "name", "string", ",", "options", "*", "v1", ".", "DeleteOptions", ")", "error", "{", "_", ",", "err", ":=", "c", ".", "Fake", ".", "Invokes", "(", "testing", ".", "NewDeleteAction", "(", "w...
// Delete takes name of the workflow and deletes it. Returns an error if one occurs.
[ "Delete", "takes", "name", "of", "the", "workflow", "and", "deletes", "it", ".", "Returns", "an", "error", "if", "one", "occurs", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/client/clientset/versioned/typed/workflow/v1alpha1/fake/fake_workflow.go#L88-L93
train
argoproj/argo
pkg/client/clientset/versioned/typed/workflow/v1alpha1/fake/fake_workflow.go
Patch
func (c *FakeWorkflows) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Workflow, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(workflowsResource, c.ns, name, data, subresources...), &v1alpha1.Workflow{}) if obj == nil { return nil, err ...
go
func (c *FakeWorkflows) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Workflow, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(workflowsResource, c.ns, name, data, subresources...), &v1alpha1.Workflow{}) if obj == nil { return nil, err ...
[ "func", "(", "c", "*", "FakeWorkflows", ")", "Patch", "(", "name", "string", ",", "pt", "types", ".", "PatchType", ",", "data", "[", "]", "byte", ",", "subresources", "...", "string", ")", "(", "result", "*", "v1alpha1", ".", "Workflow", ",", "err", ...
// Patch applies the patch and returns the patched workflow.
[ "Patch", "applies", "the", "patch", "and", "returns", "the", "patched", "workflow", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/client/clientset/versioned/typed/workflow/v1alpha1/fake/fake_workflow.go#L104-L112
train
argoproj/argo
workflow/artifacts/git/git.go
Load
func (g *GitArtifactDriver) Load(inputArtifact *wfv1.Artifact, path string) error { if g.SSHPrivateKey != "" { signer, err := ssh.ParsePrivateKey([]byte(g.SSHPrivateKey)) if err != nil { return errors.InternalWrapError(err) } auth := &ssh2.PublicKeys{User: "git", Signer: signer} if g.InsecureIgnoreHostKey...
go
func (g *GitArtifactDriver) Load(inputArtifact *wfv1.Artifact, path string) error { if g.SSHPrivateKey != "" { signer, err := ssh.ParsePrivateKey([]byte(g.SSHPrivateKey)) if err != nil { return errors.InternalWrapError(err) } auth := &ssh2.PublicKeys{User: "git", Signer: signer} if g.InsecureIgnoreHostKey...
[ "func", "(", "g", "*", "GitArtifactDriver", ")", "Load", "(", "inputArtifact", "*", "wfv1", ".", "Artifact", ",", "path", "string", ")", "error", "{", "if", "g", ".", "SSHPrivateKey", "!=", "\"", "\"", "{", "signer", ",", "err", ":=", "ssh", ".", "Pa...
// Load download artifacts from an git URL
[ "Load", "download", "artifacts", "from", "an", "git", "URL" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/artifacts/git/git.go#L31-L48
train
argoproj/argo
workflow/artifacts/git/git.go
Save
func (g *GitArtifactDriver) Save(path string, outputArtifact *wfv1.Artifact) error { return errors.Errorf(errors.CodeBadRequest, "Git output artifacts unsupported") }
go
func (g *GitArtifactDriver) Save(path string, outputArtifact *wfv1.Artifact) error { return errors.Errorf(errors.CodeBadRequest, "Git output artifacts unsupported") }
[ "func", "(", "g", "*", "GitArtifactDriver", ")", "Save", "(", "path", "string", ",", "outputArtifact", "*", "wfv1", ".", "Artifact", ")", "error", "{", "return", "errors", ".", "Errorf", "(", "errors", ".", "CodeBadRequest", ",", "\"", "\"", ")", "\n", ...
// Save is unsupported for git output artifacts
[ "Save", "is", "unsupported", "for", "git", "output", "artifacts" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/artifacts/git/git.go#L51-L53
train
argoproj/argo
cmd/argo/commands/list.go
parameterString
func parameterString(params []wfv1.Parameter) string { truncateString := func(str string, num int) string { bnoden := str if len(str) > num { if num > 3 { num -= 3 } bnoden = str[0:num-15] + "..." + str[len(str)-15:] } return bnoden } pStrs := make([]string, 0) for _, p := range params { if ...
go
func parameterString(params []wfv1.Parameter) string { truncateString := func(str string, num int) string { bnoden := str if len(str) > num { if num > 3 { num -= 3 } bnoden = str[0:num-15] + "..." + str[len(str)-15:] } return bnoden } pStrs := make([]string, 0) for _, p := range params { if ...
[ "func", "parameterString", "(", "params", "[", "]", "wfv1", ".", "Parameter", ")", "string", "{", "truncateString", ":=", "func", "(", "str", "string", ",", "num", "int", ")", "string", "{", "bnoden", ":=", "str", "\n", "if", "len", "(", "str", ")", ...
// parameterString returns a human readable display string of the parameters, truncating if necessary
[ "parameterString", "returns", "a", "human", "readable", "display", "string", "of", "the", "parameters", "truncating", "if", "necessary" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/cmd/argo/commands/list.go#L162-L182
train
argoproj/argo
cmd/argo/commands/list.go
workflowStatus
func workflowStatus(wf *wfv1.Workflow) wfv1.NodePhase { switch wf.Status.Phase { case wfv1.NodeRunning: if util.IsWorkflowSuspended(wf) { return "Running (Suspended)" } return wf.Status.Phase case wfv1.NodeFailed: if util.IsWorkflowTerminated(wf) { return "Failed (Terminated)" } return wf.Status.Ph...
go
func workflowStatus(wf *wfv1.Workflow) wfv1.NodePhase { switch wf.Status.Phase { case wfv1.NodeRunning: if util.IsWorkflowSuspended(wf) { return "Running (Suspended)" } return wf.Status.Phase case wfv1.NodeFailed: if util.IsWorkflowTerminated(wf) { return "Failed (Terminated)" } return wf.Status.Ph...
[ "func", "workflowStatus", "(", "wf", "*", "wfv1", ".", "Workflow", ")", "wfv1", ".", "NodePhase", "{", "switch", "wf", ".", "Status", ".", "Phase", "{", "case", "wfv1", ".", "NodeRunning", ":", "if", "util", ".", "IsWorkflowSuspended", "(", "wf", ")", ...
// workflowStatus returns a human readable inferred workflow status based on workflow phase and conditions
[ "workflowStatus", "returns", "a", "human", "readable", "inferred", "workflow", "status", "based", "on", "workflow", "phase", "and", "conditions" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/cmd/argo/commands/list.go#L207-L227
train
argoproj/argo
workflow/controller/exec_control.go
applyExecutionControl
func (woc *wfOperationCtx) applyExecutionControl(pod *apiv1.Pod, wfNodesLock *sync.RWMutex) error { if pod == nil { return nil } switch pod.Status.Phase { case apiv1.PodSucceeded, apiv1.PodFailed: // Skip any pod which are already completed return nil case apiv1.PodPending: // Check if we are past the work...
go
func (woc *wfOperationCtx) applyExecutionControl(pod *apiv1.Pod, wfNodesLock *sync.RWMutex) error { if pod == nil { return nil } switch pod.Status.Phase { case apiv1.PodSucceeded, apiv1.PodFailed: // Skip any pod which are already completed return nil case apiv1.PodPending: // Check if we are past the work...
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "applyExecutionControl", "(", "pod", "*", "apiv1", ".", "Pod", ",", "wfNodesLock", "*", "sync", ".", "RWMutex", ")", "error", "{", "if", "pod", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "switch"...
// applyExecutionControl will ensure a pod's execution control annotation is up-to-date // kills any pending pods when workflow has reached it's deadline
[ "applyExecutionControl", "will", "ensure", "a", "pod", "s", "execution", "control", "annotation", "is", "up", "-", "to", "-", "date", "kills", "any", "pending", "pods", "when", "workflow", "has", "reached", "it", "s", "deadline" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/exec_control.go#L19-L77
train
argoproj/argo
workflow/controller/exec_control.go
killDaemonedChildren
func (woc *wfOperationCtx) killDaemonedChildren(nodeID string) error { woc.log.Infof("Checking daemoned children of %s", nodeID) var firstErr error execCtl := common.ExecutionControl{ Deadline: &time.Time{}, } for _, childNode := range woc.wf.Status.Nodes { if childNode.BoundaryID != nodeID { continue } ...
go
func (woc *wfOperationCtx) killDaemonedChildren(nodeID string) error { woc.log.Infof("Checking daemoned children of %s", nodeID) var firstErr error execCtl := common.ExecutionControl{ Deadline: &time.Time{}, } for _, childNode := range woc.wf.Status.Nodes { if childNode.BoundaryID != nodeID { continue } ...
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "killDaemonedChildren", "(", "nodeID", "string", ")", "error", "{", "woc", ".", "log", ".", "Infof", "(", "\"", "\"", ",", "nodeID", ")", "\n", "var", "firstErr", "error", "\n", "execCtl", ":=", "common", ...
// killDaemonedChildren kill any daemoned pods of a steps or DAG template node.
[ "killDaemonedChildren", "kill", "any", "daemoned", "pods", "of", "a", "steps", "or", "DAG", "template", "node", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/exec_control.go#L80-L102
train
argoproj/argo
workflow/controller/exec_control.go
updateExecutionControl
func (woc *wfOperationCtx) updateExecutionControl(podName string, execCtl common.ExecutionControl) error { execCtlBytes, err := json.Marshal(execCtl) if err != nil { return errors.InternalWrapError(err) } woc.log.Infof("Updating execution control of %s: %s", podName, execCtlBytes) err = common.AddPodAnnotation(...
go
func (woc *wfOperationCtx) updateExecutionControl(podName string, execCtl common.ExecutionControl) error { execCtlBytes, err := json.Marshal(execCtl) if err != nil { return errors.InternalWrapError(err) } woc.log.Infof("Updating execution control of %s: %s", podName, execCtlBytes) err = common.AddPodAnnotation(...
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "updateExecutionControl", "(", "podName", "string", ",", "execCtl", "common", ".", "ExecutionControl", ")", "error", "{", "execCtlBytes", ",", "err", ":=", "json", ".", "Marshal", "(", "execCtl", ")", "\n", "if...
// updateExecutionControl updates the execution control parameters
[ "updateExecutionControl", "updates", "the", "execution", "control", "parameters" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/exec_control.go#L105-L148
train
argoproj/argo
util/cmd/cmd.go
MustIsDir
func MustIsDir(filePath string) bool { fileInfo, err := os.Stat(filePath) if err != nil { log.Fatal(err) } return fileInfo.IsDir() }
go
func MustIsDir(filePath string) bool { fileInfo, err := os.Stat(filePath) if err != nil { log.Fatal(err) } return fileInfo.IsDir() }
[ "func", "MustIsDir", "(", "filePath", "string", ")", "bool", "{", "fileInfo", ",", "err", ":=", "os", ".", "Stat", "(", "filePath", ")", "\n", "if", "err", "!=", "nil", "{", "log", ".", "Fatal", "(", "err", ")", "\n", "}", "\n", "return", "fileInfo...
// MustIsDir returns whether or not the given filePath is a directory. Exits if path does not exist
[ "MustIsDir", "returns", "whether", "or", "not", "the", "given", "filePath", "is", "a", "directory", ".", "Exits", "if", "path", "does", "not", "exist" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/util/cmd/cmd.go#L45-L51
train
argoproj/argo
util/cmd/cmd.go
MustHomeDir
func MustHomeDir() string { usr, err := user.Current() if err != nil { log.Fatal(err) } return usr.HomeDir }
go
func MustHomeDir() string { usr, err := user.Current() if err != nil { log.Fatal(err) } return usr.HomeDir }
[ "func", "MustHomeDir", "(", ")", "string", "{", "usr", ",", "err", ":=", "user", ".", "Current", "(", ")", "\n", "if", "err", "!=", "nil", "{", "log", ".", "Fatal", "(", "err", ")", "\n", "}", "\n", "return", "usr", ".", "HomeDir", "\n", "}" ]
// MustHomeDir returns the home directory of the user
[ "MustHomeDir", "returns", "the", "home", "directory", "of", "the", "user" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/util/cmd/cmd.go#L54-L60
train
argoproj/argo
util/cmd/cmd.go
IsURL
func IsURL(u string) bool { var parsedURL *url.URL var err error parsedURL, err = url.ParseRequestURI(u) if err == nil { if parsedURL != nil && parsedURL.Host != "" { return true } } return false }
go
func IsURL(u string) bool { var parsedURL *url.URL var err error parsedURL, err = url.ParseRequestURI(u) if err == nil { if parsedURL != nil && parsedURL.Host != "" { return true } } return false }
[ "func", "IsURL", "(", "u", "string", ")", "bool", "{", "var", "parsedURL", "*", "url", ".", "URL", "\n", "var", "err", "error", "\n\n", "parsedURL", ",", "err", "=", "url", ".", "ParseRequestURI", "(", "u", ")", "\n", "if", "err", "==", "nil", "{",...
// IsURL returns whether or not a string is a URL
[ "IsURL", "returns", "whether", "or", "not", "a", "string", "is", "a", "URL" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/util/cmd/cmd.go#L63-L74
train
argoproj/argo
util/unstructured/unstructured.go
NewUnstructuredInformer
func NewUnstructuredInformer(resource schema.GroupVersionResource, client dynamic.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredUnstructuredInformer(resource, client, namespace, resyncPeriod, indexers, nil) }
go
func NewUnstructuredInformer(resource schema.GroupVersionResource, client dynamic.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredUnstructuredInformer(resource, client, namespace, resyncPeriod, indexers, nil) }
[ "func", "NewUnstructuredInformer", "(", "resource", "schema", ".", "GroupVersionResource", ",", "client", "dynamic", ".", "Interface", ",", "namespace", "string", ",", "resyncPeriod", "time", ".", "Duration", ",", "indexers", "cache", ".", "Indexers", ")", "cache"...
// NewUnstructuredInformer constructs a new informer for Unstructured type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server.
[ "NewUnstructuredInformer", "constructs", "a", "new", "informer", "for", "Unstructured", "type", ".", "Always", "prefer", "using", "an", "informer", "factory", "to", "get", "a", "shared", "informer", "instead", "of", "getting", "an", "independent", "one", ".", "T...
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/util/unstructured/unstructured.go#L19-L21
train
argoproj/argo
util/unstructured/unstructured.go
NewFilteredUnstructuredInformer
func NewFilteredUnstructuredInformer(resource schema.GroupVersionResource, client dynamic.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ L...
go
func NewFilteredUnstructuredInformer(resource schema.GroupVersionResource, client dynamic.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ L...
[ "func", "NewFilteredUnstructuredInformer", "(", "resource", "schema", ".", "GroupVersionResource", ",", "client", "dynamic", ".", "Interface", ",", "namespace", "string", ",", "resyncPeriod", "time", ".", "Duration", ",", "indexers", "cache", ".", "Indexers", ",", ...
// NewFilteredUnstructuredInformer constructs a new informer for Unstructured type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server.
[ "NewFilteredUnstructuredInformer", "constructs", "a", "new", "informer", "for", "Unstructured", "type", ".", "Always", "prefer", "using", "an", "informer", "factory", "to", "get", "a", "shared", "informer", "instead", "of", "getting", "an", "independent", "one", "...
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/util/unstructured/unstructured.go#L26-L46
train
argoproj/argo
pkg/client/informers/externalversions/workflow/v1alpha1/workflow.go
NewWorkflowInformer
func NewWorkflowInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredWorkflowInformer(client, namespace, resyncPeriod, indexers, nil) }
go
func NewWorkflowInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredWorkflowInformer(client, namespace, resyncPeriod, indexers, nil) }
[ "func", "NewWorkflowInformer", "(", "client", "versioned", ".", "Interface", ",", "namespace", "string", ",", "resyncPeriod", "time", ".", "Duration", ",", "indexers", "cache", ".", "Indexers", ")", "cache", ".", "SharedIndexInformer", "{", "return", "NewFilteredW...
// NewWorkflowInformer constructs a new informer for Workflow type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server.
[ "NewWorkflowInformer", "constructs", "a", "new", "informer", "for", "Workflow", "type", ".", "Always", "prefer", "using", "an", "informer", "factory", "to", "get", "a", "shared", "informer", "instead", "of", "getting", "an", "independent", "one", ".", "This", ...
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/client/informers/externalversions/workflow/v1alpha1/workflow.go#L34-L36
train
argoproj/argo
pkg/client/informers/externalversions/workflow/v1alpha1/workflow.go
NewFilteredWorkflowInformer
func NewFilteredWorkflowInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (r...
go
func NewFilteredWorkflowInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (r...
[ "func", "NewFilteredWorkflowInformer", "(", "client", "versioned", ".", "Interface", ",", "namespace", "string", ",", "resyncPeriod", "time", ".", "Duration", ",", "indexers", "cache", ".", "Indexers", ",", "tweakListOptions", "internalinterfaces", ".", "TweakListOpti...
// NewFilteredWorkflowInformer constructs a new informer for Workflow type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server.
[ "NewFilteredWorkflowInformer", "constructs", "a", "new", "informer", "for", "Workflow", "type", ".", "Always", "prefer", "using", "an", "informer", "factory", "to", "get", "a", "shared", "informer", "instead", "of", "getting", "an", "independent", "one", ".", "T...
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/client/informers/externalversions/workflow/v1alpha1/workflow.go#L41-L61
train
argoproj/argo
pkg/client/informers/externalversions/workflow/v1alpha1/interface.go
Workflows
func (v *version) Workflows() WorkflowInformer { return &workflowInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} }
go
func (v *version) Workflows() WorkflowInformer { return &workflowInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} }
[ "func", "(", "v", "*", "version", ")", "Workflows", "(", ")", "WorkflowInformer", "{", "return", "&", "workflowInformer", "{", "factory", ":", "v", ".", "factory", ",", "namespace", ":", "v", ".", "namespace", ",", "tweakListOptions", ":", "v", ".", "twe...
// Workflows returns a WorkflowInformer.
[ "Workflows", "returns", "a", "WorkflowInformer", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/pkg/client/informers/externalversions/workflow/v1alpha1/interface.go#L27-L29
train
argoproj/argo
workflow/metrics/collector.go
NewWorkflowRegistry
func NewWorkflowRegistry(informer cache.SharedIndexInformer) *prometheus.Registry { workflowLister := util.NewWorkflowLister(informer) registry := prometheus.NewRegistry() registry.MustRegister(&workflowCollector{store: workflowLister}) return registry }
go
func NewWorkflowRegistry(informer cache.SharedIndexInformer) *prometheus.Registry { workflowLister := util.NewWorkflowLister(informer) registry := prometheus.NewRegistry() registry.MustRegister(&workflowCollector{store: workflowLister}) return registry }
[ "func", "NewWorkflowRegistry", "(", "informer", "cache", ".", "SharedIndexInformer", ")", "*", "prometheus", ".", "Registry", "{", "workflowLister", ":=", "util", ".", "NewWorkflowLister", "(", "informer", ")", "\n", "registry", ":=", "prometheus", ".", "NewRegist...
// NewWorkflowRegistry creates a new prometheus registry that collects workflows
[ "NewWorkflowRegistry", "creates", "a", "new", "prometheus", "registry", "that", "collects", "workflows" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/metrics/collector.go#L62-L67
train
argoproj/argo
workflow/metrics/collector.go
NewTelemetryRegistry
func NewTelemetryRegistry() *prometheus.Registry { registry := prometheus.NewRegistry() registry.MustRegister(prometheus.NewProcessCollector(os.Getpid(), "")) registry.MustRegister(prometheus.NewGoCollector()) return registry }
go
func NewTelemetryRegistry() *prometheus.Registry { registry := prometheus.NewRegistry() registry.MustRegister(prometheus.NewProcessCollector(os.Getpid(), "")) registry.MustRegister(prometheus.NewGoCollector()) return registry }
[ "func", "NewTelemetryRegistry", "(", ")", "*", "prometheus", ".", "Registry", "{", "registry", ":=", "prometheus", ".", "NewRegistry", "(", ")", "\n", "registry", ".", "MustRegister", "(", "prometheus", ".", "NewProcessCollector", "(", "os", ".", "Getpid", "("...
// NewTelemetryRegistry creates a new prometheus registry that collects telemetry
[ "NewTelemetryRegistry", "creates", "a", "new", "prometheus", "registry", "that", "collects", "telemetry" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/metrics/collector.go#L70-L75
train
argoproj/argo
hack/gen-openapi-spec/main.go
main
func main() { if len(os.Args) <= 1 { log.Fatal("Supply a version") } version := os.Args[1] if !strings.HasPrefix(version, "v") { version = "v" + version } oAPIDefs := wfv1.GetOpenAPIDefinitions(func(name string) spec.Ref { return spec.MustCreateRef("#/definitions/" + common.EscapeJsonPointer(swaggify(name))...
go
func main() { if len(os.Args) <= 1 { log.Fatal("Supply a version") } version := os.Args[1] if !strings.HasPrefix(version, "v") { version = "v" + version } oAPIDefs := wfv1.GetOpenAPIDefinitions(func(name string) spec.Ref { return spec.MustCreateRef("#/definitions/" + common.EscapeJsonPointer(swaggify(name))...
[ "func", "main", "(", ")", "{", "if", "len", "(", "os", ".", "Args", ")", "<=", "1", "{", "log", ".", "Fatal", "(", "\"", "\"", ")", "\n", "}", "\n", "version", ":=", "os", ".", "Args", "[", "1", "]", "\n", "if", "!", "strings", ".", "HasPre...
// Generate OpenAPI spec definitions for Workflow Resource
[ "Generate", "OpenAPI", "spec", "definitions", "for", "Workflow", "Resource" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/hack/gen-openapi-spec/main.go#L16-L49
train
argoproj/argo
workflow/controller/operator.go
newWorkflowOperationCtx
func newWorkflowOperationCtx(wf *wfv1.Workflow, wfc *WorkflowController) *wfOperationCtx { // NEVER modify objects from the store. It's a read-only, local cache. // You can use DeepCopy() to make a deep copy of original object and modify this copy // Or create a copy manually for better performance woc := wfOperati...
go
func newWorkflowOperationCtx(wf *wfv1.Workflow, wfc *WorkflowController) *wfOperationCtx { // NEVER modify objects from the store. It's a read-only, local cache. // You can use DeepCopy() to make a deep copy of original object and modify this copy // Or create a copy manually for better performance woc := wfOperati...
[ "func", "newWorkflowOperationCtx", "(", "wf", "*", "wfv1", ".", "Workflow", ",", "wfc", "*", "WorkflowController", ")", "*", "wfOperationCtx", "{", "// NEVER modify objects from the store. It's a read-only, local cache.", "// You can use DeepCopy() to make a deep copy of original o...
// newWorkflowOperationCtx creates and initializes a new wfOperationCtx object.
[ "newWorkflowOperationCtx", "creates", "and", "initializes", "a", "new", "wfOperationCtx", "object", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/operator.go#L85-L109
train
argoproj/argo
workflow/controller/operator.go
setGlobalParameters
func (woc *wfOperationCtx) setGlobalParameters() { woc.globalParams[common.GlobalVarWorkflowName] = woc.wf.ObjectMeta.Name woc.globalParams[common.GlobalVarWorkflowNamespace] = woc.wf.ObjectMeta.Namespace woc.globalParams[common.GlobalVarWorkflowUID] = string(woc.wf.ObjectMeta.UID) woc.globalParams[common.GlobalVar...
go
func (woc *wfOperationCtx) setGlobalParameters() { woc.globalParams[common.GlobalVarWorkflowName] = woc.wf.ObjectMeta.Name woc.globalParams[common.GlobalVarWorkflowNamespace] = woc.wf.ObjectMeta.Namespace woc.globalParams[common.GlobalVarWorkflowUID] = string(woc.wf.ObjectMeta.UID) woc.globalParams[common.GlobalVar...
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "setGlobalParameters", "(", ")", "{", "woc", ".", "globalParams", "[", "common", ".", "GlobalVarWorkflowName", "]", "=", "woc", ".", "wf", ".", "ObjectMeta", ".", "Name", "\n", "woc", ".", "globalParams", "["...
// setGlobalParameters sets the globalParam map with global parameters
[ "setGlobalParameters", "sets", "the", "globalParam", "map", "with", "global", "parameters" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/operator.go#L261-L284
train
argoproj/argo
workflow/controller/operator.go
requeue
func (woc *wfOperationCtx) requeue() { key, err := cache.MetaNamespaceKeyFunc(woc.wf) if err != nil { woc.log.Errorf("Failed to requeue workflow %s: %v", woc.wf.ObjectMeta.Name, err) return } woc.controller.wfQueue.Add(key) }
go
func (woc *wfOperationCtx) requeue() { key, err := cache.MetaNamespaceKeyFunc(woc.wf) if err != nil { woc.log.Errorf("Failed to requeue workflow %s: %v", woc.wf.ObjectMeta.Name, err) return } woc.controller.wfQueue.Add(key) }
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "requeue", "(", ")", "{", "key", ",", "err", ":=", "cache", ".", "MetaNamespaceKeyFunc", "(", "woc", ".", "wf", ")", "\n", "if", "err", "!=", "nil", "{", "woc", ".", "log", ".", "Errorf", "(", "\"", ...
// requeue this workflow onto the workqueue for later processing
[ "requeue", "this", "workflow", "onto", "the", "workqueue", "for", "later", "processing" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/operator.go#L409-L416
train
argoproj/argo
workflow/controller/operator.go
podReconciliation
func (woc *wfOperationCtx) podReconciliation() error { podList, err := woc.getAllWorkflowPods() if err != nil { return err } seenPods := make(map[string]bool) seenPodLock := &sync.Mutex{} wfNodesLock := &sync.RWMutex{} performAssessment := func(pod *apiv1.Pod) { if pod == nil { return } nodeNameForPo...
go
func (woc *wfOperationCtx) podReconciliation() error { podList, err := woc.getAllWorkflowPods() if err != nil { return err } seenPods := make(map[string]bool) seenPodLock := &sync.Mutex{} wfNodesLock := &sync.RWMutex{} performAssessment := func(pod *apiv1.Pod) { if pod == nil { return } nodeNameForPo...
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "podReconciliation", "(", ")", "error", "{", "podList", ",", "err", ":=", "woc", ".", "getAllWorkflowPods", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "seenPods", ":=...
// podReconciliation is the process by which a workflow will examine all its related // pods and update the node state before continuing the evaluation of the workflow. // Records all pods which were observed completed, which will be labeled completed=true // after successful persist of the workflow.
[ "podReconciliation", "is", "the", "process", "by", "which", "a", "workflow", "will", "examine", "all", "its", "related", "pods", "and", "update", "the", "node", "state", "before", "continuing", "the", "evaluation", "of", "the", "workflow", ".", "Records", "all...
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/operator.go#L463-L540
train
argoproj/argo
workflow/controller/operator.go
getAllWorkflowPods
func (woc *wfOperationCtx) getAllWorkflowPods() (*apiv1.PodList, error) { options := metav1.ListOptions{ LabelSelector: fmt.Sprintf("%s=%s", common.LabelKeyWorkflow, woc.wf.ObjectMeta.Name), } podList, err := woc.controller.kubeclientset.CoreV1().Pods(woc.wf.Namespace).List(options) if err != nil { return...
go
func (woc *wfOperationCtx) getAllWorkflowPods() (*apiv1.PodList, error) { options := metav1.ListOptions{ LabelSelector: fmt.Sprintf("%s=%s", common.LabelKeyWorkflow, woc.wf.ObjectMeta.Name), } podList, err := woc.controller.kubeclientset.CoreV1().Pods(woc.wf.Namespace).List(options) if err != nil { return...
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "getAllWorkflowPods", "(", ")", "(", "*", "apiv1", ".", "PodList", ",", "error", ")", "{", "options", ":=", "metav1", ".", "ListOptions", "{", "LabelSelector", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ...
// getAllWorkflowPods returns all pods related to the current workflow
[ "getAllWorkflowPods", "returns", "all", "pods", "related", "to", "the", "current", "workflow" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/operator.go#L592-L603
train
argoproj/argo
workflow/controller/operator.go
markWorkflowPhase
func (woc *wfOperationCtx) markWorkflowPhase(phase wfv1.NodePhase, markCompleted bool, message ...string) { if woc.wf.Status.Phase != phase { woc.log.Infof("Updated phase %s -> %s", woc.wf.Status.Phase, phase) woc.updated = true woc.wf.Status.Phase = phase if woc.wf.ObjectMeta.Labels == nil { woc.wf.ObjectM...
go
func (woc *wfOperationCtx) markWorkflowPhase(phase wfv1.NodePhase, markCompleted bool, message ...string) { if woc.wf.Status.Phase != phase { woc.log.Infof("Updated phase %s -> %s", woc.wf.Status.Phase, phase) woc.updated = true woc.wf.Status.Phase = phase if woc.wf.ObjectMeta.Labels == nil { woc.wf.ObjectM...
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "markWorkflowPhase", "(", "phase", "wfv1", ".", "NodePhase", ",", "markCompleted", "bool", ",", "message", "...", "string", ")", "{", "if", "woc", ".", "wf", ".", "Status", ".", "Phase", "!=", "phase", "{",...
// markWorkflowPhase is a convenience method to set the phase of the workflow with optional message // optionally marks the workflow completed, which sets the finishedAt timestamp and completed label
[ "markWorkflowPhase", "is", "a", "convenience", "method", "to", "set", "the", "phase", "of", "the", "workflow", "with", "optional", "message", "optionally", "marks", "the", "workflow", "completed", "which", "sets", "the", "finishedAt", "timestamp", "and", "complete...
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/operator.go#L1072-L1105
train
argoproj/argo
workflow/controller/operator.go
markNodePhase
func (woc *wfOperationCtx) markNodePhase(nodeName string, phase wfv1.NodePhase, message ...string) *wfv1.NodeStatus { node := woc.getNodeByName(nodeName) if node == nil { panic(fmt.Sprintf("node %s uninitialized", nodeName)) } if node.Phase != phase { woc.log.Infof("node %s phase %s -> %s", node, node.Phase, ph...
go
func (woc *wfOperationCtx) markNodePhase(nodeName string, phase wfv1.NodePhase, message ...string) *wfv1.NodeStatus { node := woc.getNodeByName(nodeName) if node == nil { panic(fmt.Sprintf("node %s uninitialized", nodeName)) } if node.Phase != phase { woc.log.Infof("node %s phase %s -> %s", node, node.Phase, ph...
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "markNodePhase", "(", "nodeName", "string", ",", "phase", "wfv1", ".", "NodePhase", ",", "message", "...", "string", ")", "*", "wfv1", ".", "NodeStatus", "{", "node", ":=", "woc", ".", "getNodeByName", "(", ...
// markNodePhase marks a node with the given phase, creating the node if necessary and handles timestamps
[ "markNodePhase", "marks", "a", "node", "with", "the", "given", "phase", "creating", "the", "node", "if", "necessary", "and", "handles", "timestamps" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/operator.go#L1175-L1199
train
argoproj/argo
workflow/controller/operator.go
markNodeErrorClearOuput
func (woc *wfOperationCtx) markNodeErrorClearOuput(nodeName string, err error) *wfv1.NodeStatus { nodeStatus := woc.markNodeError(nodeName, err) nodeStatus.Outputs = nil woc.wf.Status.Nodes[nodeStatus.ID] = *nodeStatus return nodeStatus }
go
func (woc *wfOperationCtx) markNodeErrorClearOuput(nodeName string, err error) *wfv1.NodeStatus { nodeStatus := woc.markNodeError(nodeName, err) nodeStatus.Outputs = nil woc.wf.Status.Nodes[nodeStatus.ID] = *nodeStatus return nodeStatus }
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "markNodeErrorClearOuput", "(", "nodeName", "string", ",", "err", "error", ")", "*", "wfv1", ".", "NodeStatus", "{", "nodeStatus", ":=", "woc", ".", "markNodeError", "(", "nodeName", ",", "err", ")", "\n", "n...
// markNodeErrorClearOuput is a convenience method to mark a node with an error and clear the output
[ "markNodeErrorClearOuput", "is", "a", "convenience", "method", "to", "mark", "a", "node", "with", "an", "error", "and", "clear", "the", "output" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/operator.go#L1202-L1207
train
argoproj/argo
workflow/controller/operator.go
markNodeError
func (woc *wfOperationCtx) markNodeError(nodeName string, err error) *wfv1.NodeStatus { return woc.markNodePhase(nodeName, wfv1.NodeError, err.Error()) }
go
func (woc *wfOperationCtx) markNodeError(nodeName string, err error) *wfv1.NodeStatus { return woc.markNodePhase(nodeName, wfv1.NodeError, err.Error()) }
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "markNodeError", "(", "nodeName", "string", ",", "err", "error", ")", "*", "wfv1", ".", "NodeStatus", "{", "return", "woc", ".", "markNodePhase", "(", "nodeName", ",", "wfv1", ".", "NodeError", ",", "err", ...
// markNodeError is a convenience method to mark a node with an error and set the message from the error
[ "markNodeError", "is", "a", "convenience", "method", "to", "mark", "a", "node", "with", "an", "error", "and", "set", "the", "message", "from", "the", "error" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/operator.go#L1210-L1212
train
argoproj/argo
workflow/controller/operator.go
getTemplateOutputsFromScope
func getTemplateOutputsFromScope(tmpl *wfv1.Template, scope *wfScope) (*wfv1.Outputs, error) { if !tmpl.Outputs.HasOutputs() { return nil, nil } var outputs wfv1.Outputs if len(tmpl.Outputs.Parameters) > 0 { outputs.Parameters = make([]wfv1.Parameter, 0) for _, param := range tmpl.Outputs.Parameters { val,...
go
func getTemplateOutputsFromScope(tmpl *wfv1.Template, scope *wfScope) (*wfv1.Outputs, error) { if !tmpl.Outputs.HasOutputs() { return nil, nil } var outputs wfv1.Outputs if len(tmpl.Outputs.Parameters) > 0 { outputs.Parameters = make([]wfv1.Parameter, 0) for _, param := range tmpl.Outputs.Parameters { val,...
[ "func", "getTemplateOutputsFromScope", "(", "tmpl", "*", "wfv1", ".", "Template", ",", "scope", "*", "wfScope", ")", "(", "*", "wfv1", ".", "Outputs", ",", "error", ")", "{", "if", "!", "tmpl", ".", "Outputs", ".", "HasOutputs", "(", ")", "{", "return"...
// getTemplateOutputsFromScope resolves a template's outputs from the scope of the template
[ "getTemplateOutputsFromScope", "resolves", "a", "template", "s", "outputs", "from", "the", "scope", "of", "the", "template" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/operator.go#L1300-L1329
train
argoproj/argo
workflow/controller/operator.go
processNodeOutputs
func (woc *wfOperationCtx) processNodeOutputs(scope *wfScope, prefix string, node *wfv1.NodeStatus) { if node.PodIP != "" { key := fmt.Sprintf("%s.ip", prefix) scope.addParamToScope(key, node.PodIP) } woc.addOutputsToScope(prefix, node.Outputs, scope) }
go
func (woc *wfOperationCtx) processNodeOutputs(scope *wfScope, prefix string, node *wfv1.NodeStatus) { if node.PodIP != "" { key := fmt.Sprintf("%s.ip", prefix) scope.addParamToScope(key, node.PodIP) } woc.addOutputsToScope(prefix, node.Outputs, scope) }
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "processNodeOutputs", "(", "scope", "*", "wfScope", ",", "prefix", "string", ",", "node", "*", "wfv1", ".", "NodeStatus", ")", "{", "if", "node", ".", "PodIP", "!=", "\"", "\"", "{", "key", ":=", "fmt", ...
// processNodeOutputs adds all of a nodes outputs to the local scope with the given prefix, as well // as the global scope, if specified with a globalName
[ "processNodeOutputs", "adds", "all", "of", "a", "nodes", "outputs", "to", "the", "local", "scope", "with", "the", "given", "prefix", "as", "well", "as", "the", "global", "scope", "if", "specified", "with", "a", "globalName" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/operator.go#L1347-L1353
train
argoproj/argo
workflow/controller/operator.go
addParamToGlobalScope
func (woc *wfOperationCtx) addParamToGlobalScope(param wfv1.Parameter) { if param.GlobalName == "" { return } index := -1 if woc.wf.Status.Outputs != nil { for i, gParam := range woc.wf.Status.Outputs.Parameters { if gParam.Name == param.GlobalName { index = i break } } } else { woc.wf.Status...
go
func (woc *wfOperationCtx) addParamToGlobalScope(param wfv1.Parameter) { if param.GlobalName == "" { return } index := -1 if woc.wf.Status.Outputs != nil { for i, gParam := range woc.wf.Status.Outputs.Parameters { if gParam.Name == param.GlobalName { index = i break } } } else { woc.wf.Status...
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "addParamToGlobalScope", "(", "param", "wfv1", ".", "Parameter", ")", "{", "if", "param", ".", "GlobalName", "==", "\"", "\"", "{", "return", "\n", "}", "\n", "index", ":=", "-", "1", "\n", "if", "woc", ...
// addParamToGlobalScope exports any desired node outputs to the global scope, and adds it to the global outputs.
[ "addParamToGlobalScope", "exports", "any", "desired", "node", "outputs", "to", "the", "global", "scope", "and", "adds", "it", "to", "the", "global", "outputs", "." ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/operator.go#L1450-L1480
train
argoproj/argo
workflow/controller/operator.go
addArtifactToGlobalScope
func (woc *wfOperationCtx) addArtifactToGlobalScope(art wfv1.Artifact, scope *wfScope) { if art.GlobalName == "" { return } globalArtName := fmt.Sprintf("workflow.outputs.artifacts.%s", art.GlobalName) if woc.wf.Status.Outputs != nil { for i, gArt := range woc.wf.Status.Outputs.Artifacts { if gArt.Name == ar...
go
func (woc *wfOperationCtx) addArtifactToGlobalScope(art wfv1.Artifact, scope *wfScope) { if art.GlobalName == "" { return } globalArtName := fmt.Sprintf("workflow.outputs.artifacts.%s", art.GlobalName) if woc.wf.Status.Outputs != nil { for i, gArt := range woc.wf.Status.Outputs.Artifacts { if gArt.Name == ar...
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "addArtifactToGlobalScope", "(", "art", "wfv1", ".", "Artifact", ",", "scope", "*", "wfScope", ")", "{", "if", "art", ".", "GlobalName", "==", "\"", "\"", "{", "return", "\n", "}", "\n", "globalArtName", ":...
// addArtifactToGlobalScope exports any desired node outputs to the global scope // Optionally adds to a local scope if supplied
[ "addArtifactToGlobalScope", "exports", "any", "desired", "node", "outputs", "to", "the", "global", "scope", "Optionally", "adds", "to", "a", "local", "scope", "if", "supplied" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/operator.go#L1484-L1520
train
argoproj/argo
workflow/controller/operator.go
addChildNode
func (woc *wfOperationCtx) addChildNode(parent string, child string) { parentID := woc.wf.NodeID(parent) childID := woc.wf.NodeID(child) node, ok := woc.wf.Status.Nodes[parentID] if !ok { panic(fmt.Sprintf("parent node %s not initialized", parent)) } for _, nodeID := range node.Children { if childID == nodeID...
go
func (woc *wfOperationCtx) addChildNode(parent string, child string) { parentID := woc.wf.NodeID(parent) childID := woc.wf.NodeID(child) node, ok := woc.wf.Status.Nodes[parentID] if !ok { panic(fmt.Sprintf("parent node %s not initialized", parent)) } for _, nodeID := range node.Children { if childID == nodeID...
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "addChildNode", "(", "parent", "string", ",", "child", "string", ")", "{", "parentID", ":=", "woc", ".", "wf", ".", "NodeID", "(", "parent", ")", "\n", "childID", ":=", "woc", ".", "wf", ".", "NodeID", ...
// addChildNode adds a nodeID as a child to a parent // parent and child are both node names
[ "addChildNode", "adds", "a", "nodeID", "as", "a", "child", "to", "a", "parent", "parent", "and", "child", "are", "both", "node", "names" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/operator.go#L1524-L1540
train
argoproj/argo
workflow/controller/operator.go
executeResource
func (woc *wfOperationCtx) executeResource(nodeName string, tmpl *wfv1.Template, boundaryID string) *wfv1.NodeStatus { node := woc.getNodeByName(nodeName) if node != nil { return node } mainCtr := woc.newExecContainer(common.MainContainerName) mainCtr.Command = []string{"argoexec", "resource", tmpl.Resource.Acti...
go
func (woc *wfOperationCtx) executeResource(nodeName string, tmpl *wfv1.Template, boundaryID string) *wfv1.NodeStatus { node := woc.getNodeByName(nodeName) if node != nil { return node } mainCtr := woc.newExecContainer(common.MainContainerName) mainCtr.Command = []string{"argoexec", "resource", tmpl.Resource.Acti...
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "executeResource", "(", "nodeName", "string", ",", "tmpl", "*", "wfv1", ".", "Template", ",", "boundaryID", "string", ")", "*", "wfv1", ".", "NodeStatus", "{", "node", ":=", "woc", ".", "getNodeByName", "(", ...
// executeResource is runs a kubectl command against a manifest
[ "executeResource", "is", "runs", "a", "kubectl", "command", "against", "a", "manifest" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/operator.go#L1543-L1558
train
argoproj/argo
workflow/controller/operator.go
getSize
func (woc *wfOperationCtx) getSize() int { nodeContent, err := json.Marshal(woc.wf) if err != nil { return -1 } compressNodeSize := len(woc.wf.Status.CompressedNodes) if compressNodeSize > 0 { nodeStatus, err := json.Marshal(woc.wf.Status.Nodes) if err != nil { return -1 } return len(nodeContent) - ...
go
func (woc *wfOperationCtx) getSize() int { nodeContent, err := json.Marshal(woc.wf) if err != nil { return -1 } compressNodeSize := len(woc.wf.Status.CompressedNodes) if compressNodeSize > 0 { nodeStatus, err := json.Marshal(woc.wf.Status.Nodes) if err != nil { return -1 } return len(nodeContent) - ...
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "getSize", "(", ")", "int", "{", "nodeContent", ",", "err", ":=", "json", ".", "Marshal", "(", "woc", ".", "wf", ")", "\n", "if", "err", "!=", "nil", "{", "return", "-", "1", "\n", "}", "\n\n", "com...
// getSize return the entire workflow json string size
[ "getSize", "return", "the", "entire", "workflow", "json", "string", "size" ]
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/operator.go#L1644-L1660
train
argoproj/argo
workflow/controller/operator.go
checkAndCompress
func (woc *wfOperationCtx) checkAndCompress() error { if woc.wf.Status.CompressedNodes != "" || (woc.wf.Status.CompressedNodes == "" && woc.getSize() >= maxWorkflowSize) { nodeContent, err := json.Marshal(woc.wf.Status.Nodes) if err != nil { return errors.InternalWrapError(err) } buff := string(nodeContent...
go
func (woc *wfOperationCtx) checkAndCompress() error { if woc.wf.Status.CompressedNodes != "" || (woc.wf.Status.CompressedNodes == "" && woc.getSize() >= maxWorkflowSize) { nodeContent, err := json.Marshal(woc.wf.Status.Nodes) if err != nil { return errors.InternalWrapError(err) } buff := string(nodeContent...
[ "func", "(", "woc", "*", "wfOperationCtx", ")", "checkAndCompress", "(", ")", "error", "{", "if", "woc", ".", "wf", ".", "Status", ".", "CompressedNodes", "!=", "\"", "\"", "||", "(", "woc", ".", "wf", ".", "Status", ".", "CompressedNodes", "==", "\"",...
// checkAndCompress will check the workflow size and compress node status if total workflow size is more than maxWorkflowSize. // The compressed content will be assign to compressedNodes element and clear the nodestatus map.
[ "checkAndCompress", "will", "check", "the", "workflow", "size", "and", "compress", "node", "status", "if", "total", "workflow", "size", "is", "more", "than", "maxWorkflowSize", ".", "The", "compressed", "content", "will", "be", "assign", "to", "compressedNodes", ...
4e37a444bde2a034885d0db35f7b38684505063e
https://github.com/argoproj/argo/blob/4e37a444bde2a034885d0db35f7b38684505063e/workflow/controller/operator.go#L1664-L1680
train
vitessio/vitess
go/vt/mysqlctl/tmutils/permissions.go
NewUserPermission
func NewUserPermission(fields []*querypb.Field, values []sqltypes.Value) *tabletmanagerdatapb.UserPermission { up := &tabletmanagerdatapb.UserPermission{ Privileges: make(map[string]string), } for i, field := range fields { switch strings.ToLower(field.Name) { case "host": up.Host = values[i].ToString() c...
go
func NewUserPermission(fields []*querypb.Field, values []sqltypes.Value) *tabletmanagerdatapb.UserPermission { up := &tabletmanagerdatapb.UserPermission{ Privileges: make(map[string]string), } for i, field := range fields { switch strings.ToLower(field.Name) { case "host": up.Host = values[i].ToString() c...
[ "func", "NewUserPermission", "(", "fields", "[", "]", "*", "querypb", ".", "Field", ",", "values", "[", "]", "sqltypes", ".", "Value", ")", "*", "tabletmanagerdatapb", ".", "UserPermission", "{", "up", ":=", "&", "tabletmanagerdatapb", ".", "UserPermission", ...
// NewUserPermission is a helper method to create a tabletmanagerdatapb.UserPermission
[ "NewUserPermission", "is", "a", "helper", "method", "to", "create", "a", "tabletmanagerdatapb", ".", "UserPermission" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/tmutils/permissions.go#L60-L80
train
vitessio/vitess
go/vt/mysqlctl/tmutils/permissions.go
UserPermissionString
func UserPermissionString(up *tabletmanagerdatapb.UserPermission) string { var passwd string if up.PasswordChecksum == 0 { passwd = "NoPassword" } else { passwd = fmt.Sprintf("PasswordChecksum(%v)", up.PasswordChecksum) } return "UserPermission " + passwd + printPrivileges(up.Privileges) }
go
func UserPermissionString(up *tabletmanagerdatapb.UserPermission) string { var passwd string if up.PasswordChecksum == 0 { passwd = "NoPassword" } else { passwd = fmt.Sprintf("PasswordChecksum(%v)", up.PasswordChecksum) } return "UserPermission " + passwd + printPrivileges(up.Privileges) }
[ "func", "UserPermissionString", "(", "up", "*", "tabletmanagerdatapb", ".", "UserPermission", ")", "string", "{", "var", "passwd", "string", "\n", "if", "up", ".", "PasswordChecksum", "==", "0", "{", "passwd", "=", "\"", "\"", "\n", "}", "else", "{", "pass...
// UserPermissionString pretty-prints a UserPermission
[ "UserPermissionString", "pretty", "-", "prints", "a", "UserPermission" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/tmutils/permissions.go#L88-L96
train
vitessio/vitess
go/vt/mysqlctl/tmutils/permissions.go
NewDbPermission
func NewDbPermission(fields []*querypb.Field, values []sqltypes.Value) *tabletmanagerdatapb.DbPermission { up := &tabletmanagerdatapb.DbPermission{ Privileges: make(map[string]string), } for i, field := range fields { switch field.Name { case "Host": up.Host = values[i].ToString() case "Db": up.Db = va...
go
func NewDbPermission(fields []*querypb.Field, values []sqltypes.Value) *tabletmanagerdatapb.DbPermission { up := &tabletmanagerdatapb.DbPermission{ Privileges: make(map[string]string), } for i, field := range fields { switch field.Name { case "Host": up.Host = values[i].ToString() case "Db": up.Db = va...
[ "func", "NewDbPermission", "(", "fields", "[", "]", "*", "querypb", ".", "Field", ",", "values", "[", "]", "sqltypes", ".", "Value", ")", "*", "tabletmanagerdatapb", ".", "DbPermission", "{", "up", ":=", "&", "tabletmanagerdatapb", ".", "DbPermission", "{", ...
// NewDbPermission is a helper method to create a tabletmanagerdatapb.DbPermission
[ "NewDbPermission", "is", "a", "helper", "method", "to", "create", "a", "tabletmanagerdatapb", ".", "DbPermission" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/tmutils/permissions.go#L109-L126
train
vitessio/vitess
go/vt/mysqlctl/tmutils/permissions.go
DbPermissionPrimaryKey
func DbPermissionPrimaryKey(dp *tabletmanagerdatapb.DbPermission) string { return dp.Host + ":" + dp.Db + ":" + dp.User }
go
func DbPermissionPrimaryKey(dp *tabletmanagerdatapb.DbPermission) string { return dp.Host + ":" + dp.Db + ":" + dp.User }
[ "func", "DbPermissionPrimaryKey", "(", "dp", "*", "tabletmanagerdatapb", ".", "DbPermission", ")", "string", "{", "return", "dp", ".", "Host", "+", "\"", "\"", "+", "dp", ".", "Db", "+", "\"", "\"", "+", "dp", ".", "User", "\n", "}" ]
// DbPermissionPrimaryKey returns the sorting key for a DbPermission
[ "DbPermissionPrimaryKey", "returns", "the", "sorting", "key", "for", "a", "DbPermission" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/tmutils/permissions.go#L129-L131
train
vitessio/vitess
go/vt/mysqlctl/tmutils/permissions.go
PermissionsString
func PermissionsString(permissions *tabletmanagerdatapb.Permissions) string { return printPermissions("User", userPermissionList(permissions.UserPermissions)) + printPermissions("Db", dbPermissionList(permissions.DbPermissions)) }
go
func PermissionsString(permissions *tabletmanagerdatapb.Permissions) string { return printPermissions("User", userPermissionList(permissions.UserPermissions)) + printPermissions("Db", dbPermissionList(permissions.DbPermissions)) }
[ "func", "PermissionsString", "(", "permissions", "*", "tabletmanagerdatapb", ".", "Permissions", ")", "string", "{", "return", "printPermissions", "(", "\"", "\"", ",", "userPermissionList", "(", "permissions", ".", "UserPermissions", ")", ")", "+", "printPermission...
// PermissionsString pretty-prints Permissions
[ "PermissionsString", "pretty", "-", "prints", "Permissions" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/tmutils/permissions.go#L158-L161
train
vitessio/vitess
go/vt/mysqlctl/tmutils/permissions.go
DiffPermissions
func DiffPermissions(leftName string, left *tabletmanagerdatapb.Permissions, rightName string, right *tabletmanagerdatapb.Permissions, er concurrency.ErrorRecorder) { diffPermissions("user", leftName, userPermissionList(left.UserPermissions), rightName, userPermissionList(right.UserPermissions), er) diffPermissions("...
go
func DiffPermissions(leftName string, left *tabletmanagerdatapb.Permissions, rightName string, right *tabletmanagerdatapb.Permissions, er concurrency.ErrorRecorder) { diffPermissions("user", leftName, userPermissionList(left.UserPermissions), rightName, userPermissionList(right.UserPermissions), er) diffPermissions("...
[ "func", "DiffPermissions", "(", "leftName", "string", ",", "left", "*", "tabletmanagerdatapb", ".", "Permissions", ",", "rightName", "string", ",", "right", "*", "tabletmanagerdatapb", ".", "Permissions", ",", "er", "concurrency", ".", "ErrorRecorder", ")", "{", ...
// DiffPermissions records the errors between two permission sets
[ "DiffPermissions", "records", "the", "errors", "between", "two", "permission", "sets" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/tmutils/permissions.go#L205-L208
train
vitessio/vitess
go/vt/mysqlctl/tmutils/permissions.go
DiffPermissionsToArray
func DiffPermissionsToArray(leftName string, left *tabletmanagerdatapb.Permissions, rightName string, right *tabletmanagerdatapb.Permissions) (result []string) { er := concurrency.AllErrorRecorder{} DiffPermissions(leftName, left, rightName, right, &er) if er.HasErrors() { return er.ErrorStrings() } return nil }
go
func DiffPermissionsToArray(leftName string, left *tabletmanagerdatapb.Permissions, rightName string, right *tabletmanagerdatapb.Permissions) (result []string) { er := concurrency.AllErrorRecorder{} DiffPermissions(leftName, left, rightName, right, &er) if er.HasErrors() { return er.ErrorStrings() } return nil }
[ "func", "DiffPermissionsToArray", "(", "leftName", "string", ",", "left", "*", "tabletmanagerdatapb", ".", "Permissions", ",", "rightName", "string", ",", "right", "*", "tabletmanagerdatapb", ".", "Permissions", ")", "(", "result", "[", "]", "string", ")", "{", ...
// DiffPermissionsToArray difs two sets of permissions, and returns the difference
[ "DiffPermissionsToArray", "difs", "two", "sets", "of", "permissions", "and", "returns", "the", "difference" ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/mysqlctl/tmutils/permissions.go#L211-L218
train
vitessio/vitess
go/vt/vitessdriver/rows.go
newRows
func newRows(qr *sqltypes.Result, c *converter) driver.Rows { return &rows{qr: qr, convert: c} }
go
func newRows(qr *sqltypes.Result, c *converter) driver.Rows { return &rows{qr: qr, convert: c} }
[ "func", "newRows", "(", "qr", "*", "sqltypes", ".", "Result", ",", "c", "*", "converter", ")", "driver", ".", "Rows", "{", "return", "&", "rows", "{", "qr", ":", "qr", ",", "convert", ":", "c", "}", "\n", "}" ]
// newRows creates a new rows from qr.
[ "newRows", "creates", "a", "new", "rows", "from", "qr", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vitessdriver/rows.go#L35-L37
train
vitessio/vitess
go/vt/servenv/unix_socket.go
serveSocketFile
func serveSocketFile() { if SocketFile == nil || *SocketFile == "" { log.Infof("Not listening on socket file") return } name := *SocketFile // try to delete if file exists if _, err := os.Stat(name); err == nil { err = os.Remove(name) if err != nil { log.Exitf("Cannot remove socket file %v: %v", name, ...
go
func serveSocketFile() { if SocketFile == nil || *SocketFile == "" { log.Infof("Not listening on socket file") return } name := *SocketFile // try to delete if file exists if _, err := os.Stat(name); err == nil { err = os.Remove(name) if err != nil { log.Exitf("Cannot remove socket file %v: %v", name, ...
[ "func", "serveSocketFile", "(", ")", "{", "if", "SocketFile", "==", "nil", "||", "*", "SocketFile", "==", "\"", "\"", "{", "log", ".", "Infof", "(", "\"", "\"", ")", "\n", "return", "\n", "}", "\n", "name", ":=", "*", "SocketFile", "\n\n", "// try to...
// serveSocketFile listen to the named socket and serves RPCs on it.
[ "serveSocketFile", "listen", "to", "the", "named", "socket", "and", "serves", "RPCs", "on", "it", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/servenv/unix_socket.go#L34-L55
train
vitessio/vitess
go/vt/vtgate/safe_session.go
NewAutocommitSession
func NewAutocommitSession(sessn *vtgatepb.Session) *SafeSession { newSession := proto.Clone(sessn).(*vtgatepb.Session) newSession.InTransaction = false newSession.ShardSessions = nil newSession.Autocommit = true return NewSafeSession(newSession) }
go
func NewAutocommitSession(sessn *vtgatepb.Session) *SafeSession { newSession := proto.Clone(sessn).(*vtgatepb.Session) newSession.InTransaction = false newSession.ShardSessions = nil newSession.Autocommit = true return NewSafeSession(newSession) }
[ "func", "NewAutocommitSession", "(", "sessn", "*", "vtgatepb", ".", "Session", ")", "*", "SafeSession", "{", "newSession", ":=", "proto", ".", "Clone", "(", "sessn", ")", ".", "(", "*", "vtgatepb", ".", "Session", ")", "\n", "newSession", ".", "InTransacti...
// NewAutocommitSession returns a SafeSession based on the original // session, but with autocommit enabled.
[ "NewAutocommitSession", "returns", "a", "SafeSession", "based", "on", "the", "original", "session", "but", "with", "autocommit", "enabled", "." ]
d568817542a413611801aa17a1c213aa95592182
https://github.com/vitessio/vitess/blob/d568817542a413611801aa17a1c213aa95592182/go/vt/vtgate/safe_session.go#L73-L79
train