From 108095fdce6c7b1b3d411aff21440d5d96c8c5af Mon Sep 17 00:00:00 2001 From: shivramsrivastava Date: Thu, 2 May 2019 15:33:06 +0530 Subject: [PATCH] Fixed the Pod failure event reason string for the k8s conformance test to PASS --- pkg/scheduler/cache/cache.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/scheduler/cache/cache.go b/pkg/scheduler/cache/cache.go index f6f1c04d2..443cf990c 100644 --- a/pkg/scheduler/cache/cache.go +++ b/pkg/scheduler/cache/cache.go @@ -465,7 +465,10 @@ func (sc *SchedulerCache) taskUnschedulable(task *api.TaskInfo, message string) pod := task.Pod.DeepCopy() - sc.Recorder.Eventf(pod, v1.EventTypeWarning, string(v1.PodReasonUnschedulable), message) + // The reason field in 'Events' should be "FailedScheduling", there is not constants defined for this in + // k8s core, so using the same string here. + // The reason field in PodCondition should be "Unschedulable" + sc.Recorder.Eventf(pod, v1.EventTypeWarning, "FailedScheduling", message) if _, err := sc.StatusUpdater.UpdatePodCondition(pod, &v1.PodCondition{ Type: v1.PodScheduled, Status: v1.ConditionFalse,