craigcondit commented on code in PR #954:
URL: https://github.com/apache/yunikorn-k8shim/pull/954#discussion_r1977945456
##########
pkg/cache/context.go:
##########
@@ -317,7 +325,18 @@ func (ctx *Context) updateYuniKornPod(appID string, pod
*v1.Pod) {
return
}
- if ctx.schedulerCache.UpdatePod(pod) {
+ hasGates := len(pod.Spec.SchedulingGates) > 0
+ if hasGates && oldPod == nil {
+ gates := make([]string, 0, len(pod.Spec.SchedulingGates))
+ for _, gate := range pod.Spec.SchedulingGates {
+ gates = append(gates, gate.Name)
+ }
+ events.GetRecorder().Eventf(pod.DeepCopy(), nil,
v1.EventTypeNormal, "Scheduling", "Scheduling",
+ "waiting for scheduling gates: %s", strings.Join(gates,
","))
+ log.Log(log.ShimContext).Info("pod is waiting for scheduling
gates", zap.String("name", pod.Name), zap.Strings("gates", gates))
+ }
+
+ if ctx.schedulerCache.UpdatePod(pod) && !hasGates {
// pod was accepted; ensure the application and task objects
have been created
ctx.ensureAppAndTaskCreated(pod, app)
Review Comment:
I'm okay with this for now. I still think maybe there might be value in
doing this differently in the future. At the bare minimum, for observability,
as pods in this state will be effectively invisible to YuniKorn (and REST API,
etc.)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]