Use const value for pod's conditions

pull/6/head
FengyunPan 2017-04-20 10:43:24 +08:00
parent fba605ce05
commit 1bad02cb22
2 changed files with 2 additions and 2 deletions

View File

@ -68,7 +68,7 @@ func AnalysePods(selectorv1 *metav1.LabelSelector, allPods []util.FederatedObjec
} else {
if condition.Type == api_v1.PodScheduled &&
condition.Status == api_v1.ConditionFalse &&
condition.Reason == "Unschedulable" &&
condition.Reason == api_v1.PodReasonUnschedulable &&
condition.LastTransitionTime.Add(UnschedulableThreshold).Before(currentTime) {
status.Unschedulable++

View File

@ -49,7 +49,7 @@ func TestAnalyze(t *testing.T) {
{
Type: api_v1.PodScheduled,
Status: api_v1.ConditionFalse,
Reason: "Unschedulable",
Reason: api_v1.PodReasonUnschedulable,
LastTransitionTime: metav1.Time{Time: now.Add(-10 * time.Minute)},
},
},