MCPcopy
hub / github.com/argoproj/argo-workflows / NewContextFromClientSet

Function NewContextFromClientSet

workflow/templateresolution/context.go:98–106  ·  view source on GitHub ↗

NewContextFromClientSet returns new Context.

(wftmplClientset typed.WorkflowTemplateInterface, clusterWftmplClient typed.ClusterWorkflowTemplateInterface, tmplBase wfv1.TemplateHolder, workflow *wfv1.Workflow, log logging.Logger)

Source from the content-addressed store, hash-verified

96
97// NewContextFromClientSet returns new Context.
98func NewContextFromClientSet(wftmplClientset typed.WorkflowTemplateInterface, clusterWftmplClient typed.ClusterWorkflowTemplateInterface, tmplBase wfv1.TemplateHolder, workflow *wfv1.Workflow, log logging.Logger) *TemplateContext {
99 return &TemplateContext{
100 wftmplGetter: WrapWorkflowTemplateInterface(wftmplClientset),
101 cwftmplGetter: WrapClusterWorkflowTemplateInterface(clusterWftmplClient),
102 tmplBase: tmplBase,
103 workflow: workflow,
104 log: log,
105 }
106}
107
108// GetTemplateByName returns a template by name in the context.
109func (tplCtx *TemplateContext) GetTemplateByName(ctx context.Context, name string) (*wfv1.Template, error) {