From 9b7e40570e5914f7e799738f9cb86e63068177c4 Mon Sep 17 00:00:00 2001 From: Sergiusz Urbaniak Date: Tue, 10 Nov 2015 20:54:58 +0100 Subject: [PATCH] scheduler: fix shadowing in doSchedule --- contrib/mesos/pkg/scheduler/plugin.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/mesos/pkg/scheduler/plugin.go b/contrib/mesos/pkg/scheduler/plugin.go index d7a6d77aa73..0bbf03f300c 100644 --- a/contrib/mesos/pkg/scheduler/plugin.go +++ b/contrib/mesos/pkg/scheduler/plugin.go @@ -321,7 +321,10 @@ func (k *kubeScheduler) doSchedule(task *podtask.T) (string, error) { if task.HasAcceptedOffer() { // verify that the offer is still on the table - if offer, ok := k.api.offers().Get(task.GetOfferId()); !ok || offer.HasExpired() { + var ok bool + offer, ok = k.api.offers().Get(task.GetOfferId()) + + if !ok || offer.HasExpired() { task.Offer.Release() task.Reset() if err = k.api.tasks().Update(task); err != nil {