From a911699de1ad38c423de472d1412469feb1c58be Mon Sep 17 00:00:00 2001 From: Vibhav Bobade Date: Wed, 25 Dec 2019 15:48:14 +0530 Subject: [PATCH] Add SchedulerName to TaskRunSpec Set scheduler in TaskRunSpec to execute Tasks with specific schedulers. --- pkg/apis/pipeline/v1alpha1/taskrun_types.go | 4 ++++ pkg/pod/pod.go | 1 + 2 files changed, 5 insertions(+) diff --git a/pkg/apis/pipeline/v1alpha1/taskrun_types.go b/pkg/apis/pipeline/v1alpha1/taskrun_types.go index 2915b77d9dd..16cd67bef0c 100644 --- a/pkg/apis/pipeline/v1alpha1/taskrun_types.go +++ b/pkg/apis/pipeline/v1alpha1/taskrun_types.go @@ -56,6 +56,10 @@ type TaskRunSpec struct { // Workspaces is a list of WorkspaceBindings from volumes to workspaces. // +optional Workspaces []WorkspaceBinding `json:"workspaces,omitempty"` + + // SchedulerName specifies the scheduler to be used to dispath the Pod + // +optional + SchedulerName string `json:"schedulerName"` } // TaskRunSpecStatus defines the taskrun spec status the user can provide diff --git a/pkg/pod/pod.go b/pkg/pod/pod.go index 5c3c156d176..bfe42d18bb6 100644 --- a/pkg/pod/pod.go +++ b/pkg/pod/pod.go @@ -210,6 +210,7 @@ func MakePod(images pipeline.Images, taskRun *v1alpha1.TaskRun, taskSpec v1alpha ServiceAccountName: taskRun.Spec.ServiceAccountName, Volumes: volumes, NodeSelector: taskRun.Spec.PodTemplate.NodeSelector, + SchedulerName: taskRun.Spec.SchedulerName, Tolerations: taskRun.Spec.PodTemplate.Tolerations, Affinity: taskRun.Spec.PodTemplate.Affinity, SecurityContext: taskRun.Spec.PodTemplate.SecurityContext,