mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 20:42:26 +00:00
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:
parent
d53b716e97
commit
71bd54adc6
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user