-
Notifications
You must be signed in to change notification settings - Fork 273
/
workflow_types.go
34 lines (31 loc) 路 1.35 KB
/
workflow_types.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
// Package represents https://pkg.go.dev/github.com/tinkerbell/tink@v0.6.0/workflow#pkg-types with json tags.
//+kubebuilder:object:generate=true
package tinkerbell
// Workflow represents a workflow to be executed.
type Workflow struct {
Version string `json:"version"`
Name string `json:"name"`
ID string `json:"id"`
GlobalTimeout int `json:"global_timeout"`
Tasks []Task `json:"tasks"`
}
// Task represents a task to be executed as part of a workflow.
type Task struct {
Name string `json:"name"`
WorkerAddr string `json:"worker"`
Actions []Action `json:"actions"`
Volumes []string `json:"volumes,omitempty"`
Environment map[string]string `json:"environment,omitempty"`
}
// Action is the basic executional unit for a workflow.
type Action struct {
Name string `json:"name"`
Image string `json:"image"`
Timeout int64 `json:"timeout"`
Command []string `json:"command,omitempty"`
OnTimeout []string `json:"on-timeout,omitempty"`
OnFailure []string `json:"on-failure,omitempty"`
Volumes []string `json:"volumes,omitempty"`
Environment map[string]string `json:"environment,omitempty" yaml:"environment,omitempty"`
Pid string `json:"pid,omitempty"`
}