Skip to content

Commit

Permalink
fix: add priority field to submitopts (#7572)
Browse files Browse the repository at this point in the history
Signed-off-by: Isitha Subasinghe <isitha@pipekit.io>
  • Loading branch information
isubasinghe authored Jan 17, 2022
1 parent 81118d1 commit dbb1bcf
Show file tree
Hide file tree
Showing 12 changed files with 531 additions and 464 deletions.
4 changes: 4 additions & 0 deletions api/jsonschema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6562,6 +6562,10 @@
"description": "Set the podPriorityClassName of the workflow",
"type": "string"
},
"priority": {
"description": "Priority is used if controller is configured to process limited number of workflows in parallel, higher priority workflows are processed first.",
"type": "integer"
},
"serverDryRun": {
"description": "ServerDryRun validates the workflow on the server-side without creating it",
"type": "boolean"
Expand Down
4 changes: 4 additions & 0 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -10825,6 +10825,10 @@
"description": "Set the podPriorityClassName of the workflow",
"type": "string"
},
"priority": {
"description": "Priority is used if controller is configured to process limited number of workflows in parallel, higher priority workflows are processed first.",
"type": "integer"
},
"serverDryRun": {
"description": "ServerDryRun validates the workflow on the server-side without creating it",
"type": "boolean"
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/workflow/v1alpha1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,7 @@ type SubmitOpts struct {
Annotations string `json:"annotations,omitempty" protobuf:"bytes,12,opt,name=annotations"`
// Set the podPriorityClassName of the workflow
PodPriorityClassName string `json:"podPriorityClassName,omitempty" protobuf:"bytes,13,opt,name=podPriorityClassName"`
// Priority is used if controller is configured to process limited number of workflows in parallel, higher priority workflows
// are processed first.
Priority *int32 `json:"priority,omitempty" protobuf:"bytes,14,opt,name=priority"`
}
957 changes: 493 additions & 464 deletions pkg/apis/workflow/v1alpha1/generated.pb.go

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions pkg/apis/workflow/v1alpha1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pkg/apis/workflow/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Name | Type | Description | Notes
**parameterFile** | **String** | ParameterFile holds a reference to a parameter file. This option is not supported in API | [optional]
**parameters** | **List&lt;String&gt;** | Parameters passes input parameters to workflow | [optional]
**podPriorityClassName** | **String** | Set the podPriorityClassName of the workflow | [optional]
**priority** | **Integer** | Priority is used if controller is configured to process limited number of workflows in parallel, higher priority workflows are processed first. | [optional]
**serverDryRun** | **Boolean** | ServerDryRun validates the workflow on the server-side without creating it | [optional]
**serviceAccount** | **String** | ServiceAccount runs all pods in the workflow using specified ServiceAccount. | [optional]

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sdks/python/client/docs/WorkflowServiceApi.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions workflow/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ func ApplySubmitOpts(wf *wfv1.Workflow, opts *wfv1.SubmitOpts) error {
wf.Spec.PodPriorityClassName = opts.PodPriorityClassName
}

if opts.Priority != nil {
wf.Spec.Priority = opts.Priority
}

wfLabels := wf.GetLabels()
if wfLabels == nil {
wfLabels = make(map[string]string)
Expand Down

0 comments on commit dbb1bcf

Please sign in to comment.