scheduler: remove shadowed offer var in doSchedule

The variable `offer` is shadowed in the if block causing the `then`
branch to be non-effective.
This commit is contained in:
Sergiusz Urbaniak 2015-10-20 14:40:24 -07:00
parent d53b716e97
commit 71bd54adc6

View File

@ -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 {