Skip to content

Commit

Permalink
tmp: use tentative node name if not scheduled yet
Browse files Browse the repository at this point in the history
  • Loading branch information
sharnoff committed Dec 12, 2024
1 parent 7a60333 commit 7b5f938
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/plugin/handle_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,17 @@ func (s *PluginState) updatePod(
return nil
}

logger = logger.With(logFieldForNodeName(pod.Spec.NodeName))
nodeName := pod.Spec.NodeName
if nodeName == "" {
nodeName = tentativeNode
}

logger = logger.With(logFieldForNodeName(nodeName))

var ok bool
ns, ok = s.nodes[pod.Spec.NodeName]
ns, ok = s.nodes[nodeName]
if !ok {
return fmt.Errorf("pod's node %q is not present in local state", pod.Spec.NodeName)
return fmt.Errorf("pod's node %q is not present in local state", nodeName)
}

// make the changes in Speculatively() so that we can log both states before committing, and
Expand Down

0 comments on commit 7b5f938

Please sign in to comment.