File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ The following variables are made available to reference various metadata of a wo
51
51
| ` workflow.labels.<NAME> ` | Workflow labels |
52
52
| ` workflow.creationTimestamp ` | Workflow creation timestamp formatted in RFC 3339 (e.g. ` 2018-08-23T05:42:49Z ` ) |
53
53
| ` workflow.creationTimestamp.<STRFTIMECHAR> ` | Creation timestamp formatted with a [ strftime] ( http://strftime.org ) format character |
54
-
54
+ | ` workflow.priority ` | Workflow priority |
55
55
56
56
## Exit Handler:
57
57
| Variable | Description|
Original file line number Diff line number Diff line change @@ -109,8 +109,10 @@ const (
109
109
GlobalVarWorkflowUID = "workflow.uid"
110
110
// GlobalVarWorkflowStatus is a global workflow variable referencing the workflow's status.phase field
111
111
GlobalVarWorkflowStatus = "workflow.status"
112
- // GlobalVarWorkflowCreationTimestamp is the workflow variable referencing the workflows metadata.creationTimestamp field
112
+ // GlobalVarWorkflowCreationTimestamp is the workflow variable referencing the workflow's metadata.creationTimestamp field
113
113
GlobalVarWorkflowCreationTimestamp = "workflow.creationTimestamp"
114
+ // GlobalVarWorkflowPriority is the workflow variable referencing the workflow's priority field
115
+ GlobalVarWorkflowPriority = "workflow.priority"
114
116
// LocalVarPodName is a step level variable that references the name of the pod
115
117
LocalVarPodName = "pod.name"
116
118
Original file line number Diff line number Diff line change @@ -265,6 +265,9 @@ func (woc *wfOperationCtx) setGlobalParameters() {
265
265
woc .globalParams [common .GlobalVarWorkflowNamespace ] = woc .wf .ObjectMeta .Namespace
266
266
woc .globalParams [common .GlobalVarWorkflowUID ] = string (woc .wf .ObjectMeta .UID )
267
267
woc .globalParams [common .GlobalVarWorkflowCreationTimestamp ] = woc .wf .ObjectMeta .CreationTimestamp .String ()
268
+ if woc .wf .Spec .Priority != nil {
269
+ woc .globalParams [common .GlobalVarWorkflowPriority ] = strconv .Itoa (int (* woc .wf .Spec .Priority ))
270
+ }
268
271
for char := range strftime .FormatChars {
269
272
cTimeVar := fmt .Sprintf ("%s.%s" , common .GlobalVarWorkflowCreationTimestamp , string (char ))
270
273
woc .globalParams [cTimeVar ] = strftime .Format ("%" + string (char ), woc .wf .ObjectMeta .CreationTimestamp .Time )
You can’t perform that action at this time.
0 commit comments