From 71bd54adc619f882257cc1987941ad7d6ae32481 Mon Sep 17 00:00:00 2001 From: Sergiusz Urbaniak Date: Tue, 20 Oct 2015 14:40:24 -0700 Subject: [PATCH] scheduler: remove shadowed `offer` var in doSchedule The variable `offer` is shadowed in the if block causing the `then` branch to be non-effective. --- contrib/mesos/pkg/scheduler/plugin.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/contrib/mesos/pkg/scheduler/plugin.go b/contrib/mesos/pkg/scheduler/plugin.go index 3733033af86..a1bd3450434 100644 --- a/contrib/mesos/pkg/scheduler/plugin.go +++ b/contrib/mesos/pkg/scheduler/plugin.go @@ -313,11 +313,7 @@ func (k *kubeScheduler) doSchedule(task *podtask.T) (string, error) { if task.HasAcceptedOffer() { // verify that the offer is still on the table - offerId := task.GetOfferId() - if offer, ok := k.api.offers().Get(offerId); ok && !offer.HasExpired() { - // skip tasks that have already have assigned offers - offer = task.Offer - } else { + if offer, ok := k.api.offers().Get(task.GetOfferId()); !ok || offer.HasExpired() { task.Offer.Release() task.Reset() if err = k.api.tasks().Update(task); err != nil {