Skip to content

Commit

Permalink
ignore worker pods in UpdatePod as well
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Gupta <[email protected]>
  • Loading branch information
varungup90 committed Mar 3, 2025
1 parent 113533a commit 4500c19
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ func (c *Cache) addPod(obj interface{}) {
// ignore worker pods
nodeType, ok := pod.Labels[nodeType]
if ok && nodeType == "worker" {

Check failure on line 302 in pkg/cache/cache.go

View workflow job for this annotation

GitHub Actions / lint

string `worker` has 3 occurrences, make it a constant (goconst)
klog.InfoS("ignored ray worker pod", "name", pod.Name)
return
}

Expand Down Expand Up @@ -329,6 +330,20 @@ func (c *Cache) updatePod(oldObj interface{}, newObj interface{}) {
c.deletePodAndModelMapping(oldPod.Name, oldModelName)
}

// ignore worker pods
nodeType, ok := oldPod.Labels[nodeType]
if ok && nodeType == "worker" {
klog.InfoS("ignored ray worker pod", "name", oldPod.Name)
return
}

// ignore worker pods
nodeType, ok = newPod.Labels[nodeType]
if ok && nodeType == "worker" {
klog.InfoS("ignored ray worker pod", "name", newPod.Name)
return
}

// Add new mappings if present
if newOk {
c.Pods[newPod.Name] = newPod
Expand Down

0 comments on commit 4500c19

Please sign in to comment.