Skip to content

Commit fbd602f

Browse files
committed
Reuse shared Pod readiness check
Signed-off-by: Mathis Felardos <mathis@mistral.ai>
1 parent 5e2d009 commit fbd602f

1 file changed

Lines changed: 2 additions & 13 deletions

File tree

  • pkg/epp/framework/plugins/requestcontrol/screener/disaggregatedsetrollout

pkg/epp/framework/plugins/requestcontrol/screener/disaggregatedsetrollout/plugin.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
fwkrc "github.com/llm-d/llm-d-router/pkg/epp/framework/interface/requestcontrol"
3535
fwksched "github.com/llm-d/llm-d-router/pkg/epp/framework/interface/scheduling"
3636
sourcenotifications "github.com/llm-d/llm-d-router/pkg/epp/framework/plugins/datalayer/source/notifications"
37+
podutil "github.com/llm-d/llm-d-router/pkg/epp/util/pod"
3738
)
3839

3940
const (
@@ -205,7 +206,7 @@ func (c *Screener) acceptsPod(pod *corev1.Pod) bool {
205206
if pod == nil || !c.config.RevisionGating.Active() {
206207
return false
207208
}
208-
if !c.scope.Matches(labels.Set(pod.Labels)) || !isPodReady(pod) {
209+
if !c.scope.Matches(labels.Set(pod.Labels)) || !podutil.IsPodReady(pod) {
209210
return false
210211
}
211212
return pod.Labels[c.revisionLabelKey] != "" && pod.Labels[c.roleLabelKey] != ""
@@ -298,15 +299,3 @@ func (c *Screener) distributionSnapshot() revisionDistribution {
298299
defer c.mu.RUnlock()
299300
return c.distribution
300301
}
301-
302-
func isPodReady(pod *corev1.Pod) bool {
303-
if pod == nil || pod.Status.Phase != corev1.PodRunning || pod.DeletionTimestamp != nil {
304-
return false
305-
}
306-
for _, condition := range pod.Status.Conditions {
307-
if condition.Type == corev1.PodReady {
308-
return condition.Status == corev1.ConditionTrue
309-
}
310-
}
311-
return false
312-
}

0 commit comments

Comments
 (0)