From 9522e0ef12a38739e0d94b40edc281568188b818 Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Tue, 8 Dec 2015 14:39:49 +0100 Subject: [PATCH] contrib/mesos/scheduler: create nodes with ready condition The current kube-ui version (compare https://github.com/kubernetes/kube-ui/pull/37/files#r46950087) assumes that the first node condition is the Ready condition. This PR works around this by enforcing the Ready condition to be the first one. A parallel PR against kube-ui is on the way. --- contrib/mesos/pkg/node/node.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/contrib/mesos/pkg/node/node.go b/contrib/mesos/pkg/node/node.go index 27e20cae034..ea182ee2962 100644 --- a/contrib/mesos/pkg/node/node.go +++ b/contrib/mesos/pkg/node/node.go @@ -21,13 +21,13 @@ import ( "reflect" "strconv" "strings" - "time" log "github.com/golang/glog" mesos "github.com/mesos/mesos-go/mesosproto" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" + "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/util/validation" ) @@ -55,6 +55,19 @@ func Create( }, Status: api.NodeStatus{ Phase: api.NodePending, + // WORKAROUND(sttts): make sure that the Ready condition is the + // first one. The kube-ui v3 depends on this assumption. + // TODO(sttts): remove this workaround when kube-ui v4 is used or we + // merge this with the statusupdate in the controller manager. + Conditions: []api.NodeCondition{ + { + Type: api.NodeReady, + Status: api.ConditionTrue, + Reason: slaveReadyReason, + Message: slaveReadyMessage, + LastHeartbeatTime: unversioned.Now(), + }, + }, }, }