Skip to content

Commit

Permalink
UPSTREAM: <carry>: Bug 2062459: Generate event when cache update is f…
Browse files Browse the repository at this point in the history
…ailed
  • Loading branch information
ravisantoshgudimetla committed May 4, 2022
1 parent a8f15f6 commit 6f15ddb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/scheduler/scheduler.go
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"fmt"
"math/rand"
"os"
"strconv"
"time"

Expand Down Expand Up @@ -415,8 +416,11 @@ func (sched *Scheduler) finishBinding(fwk framework.Framework, assumed *v1.Pod,
klog.V(1).InfoS("Failed to bind pod", "pod", klog.KObj(assumed))
return
}

fwk.EventRecorder().Eventf(assumed, nil, v1.EventTypeNormal, "Scheduled", "Binding", "Successfully assigned %v/%v to %v", assumed.Namespace, assumed.Name, targetNode)
name, err := os.Hostname()
if err != nil {
klog.V(1).Info("Failed to get host name")
}
fwk.EventRecorder().Eventf(assumed, nil, v1.EventTypeNormal, "Scheduled", "Binding", "Successfully assigned %v/%v to %v by %v", assumed.Namespace, assumed.Name, targetNode, name)
}

var (
Expand Down

0 comments on commit 6f15ddb

Please sign in to comment.