From 859077b70183993f492fd2d3de66b9effcd6fef1 Mon Sep 17 00:00:00 2001 From: Marcin Wielgus Date: Wed, 12 Oct 2016 17:43:24 +0200 Subject: [PATCH] Make "Unschedulable" reason a constant in api --- pkg/api/types.go | 3 +++ pkg/api/v1/types.go | 3 +++ plugin/pkg/scheduler/scheduler.go | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/api/types.go b/pkg/api/types.go index 8f08fe8dbc5..56853db9f26 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -1225,6 +1225,9 @@ const ( PodReady PodConditionType = "Ready" // PodInitialized means that all init containers in the pod have started successfully. PodInitialized PodConditionType = "Initialized" + // PodReasonUnschedulable reason in PodScheduled PodCondition means that the scheduler + // can't schedule the pod right now, for example due to insufficient resources in the cluster. + PodReasonUnschedulable = "Unschedulable" ) type PodCondition struct { diff --git a/pkg/api/v1/types.go b/pkg/api/v1/types.go index e2a6424a47b..63bb2697a82 100644 --- a/pkg/api/v1/types.go +++ b/pkg/api/v1/types.go @@ -1439,6 +1439,9 @@ const ( // PodReady means the pod is able to service requests and should be added to the // load balancing pools of all matching services. PodReady PodConditionType = "Ready" + // PodReasonUnschedulable reason in PodScheduled PodCondition means that the scheduler + // can't schedule the pod right now, for example due to insufficient resources in the cluster. + PodReasonUnschedulable = "Unschedulable" ) // PodCondition contains details for the current condition of this pod. diff --git a/plugin/pkg/scheduler/scheduler.go b/plugin/pkg/scheduler/scheduler.go index 8b85398fd25..d5b8cc0a912 100644 --- a/plugin/pkg/scheduler/scheduler.go +++ b/plugin/pkg/scheduler/scheduler.go @@ -100,7 +100,7 @@ func (s *Scheduler) scheduleOne() { s.config.PodConditionUpdater.Update(pod, &api.PodCondition{ Type: api.PodScheduled, Status: api.ConditionFalse, - Reason: "Unschedulable", + Reason: api.PodReasonUnschedulable, }) return }