-
Notifications
You must be signed in to change notification settings - Fork 3.3k
/
Copy pathtemplate_executor_plugin.go
49 lines (40 loc) · 1.06 KB
/
template_executor_plugin.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package executor
import (
"context"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
)
// swagger:parameters executeTemplate
type ExecuteTemplateRequest struct {
// in: body
// Required: true
Body ExecuteTemplateArgs
}
type ExecuteTemplateArgs struct {
// Required: true
Workflow *Workflow `json:"workflow"`
// Required: true
Template *wfv1.Template `json:"template"`
}
// swagger:response executeTemplate
type ExecuteTemplateResponse struct {
// in: body
Body ExecuteTemplateReply
}
type ExecuteTemplateReply struct {
Node *wfv1.NodeResult `json:"node,omitempty"`
Requeue *metav1.Duration `json:"requeue,omitempty"`
}
func (r ExecuteTemplateReply) GetRequeue() time.Duration {
if r.Requeue != nil {
return r.Requeue.Duration
}
return 0
}
type TemplateExecutor interface {
// swagger:route POST /template.execute executeTemplate
// Responses:
// 200: executeTemplate
ExecuteTemplate(ctx context.Context, args ExecuteTemplateArgs, reply *ExecuteTemplateReply) error
}