mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
changes in non-test files
This commit is contained in:
parent
1eb9d42c3f
commit
121d24cfc7
@ -240,9 +240,8 @@ func (pl *InterPodAffinity) PreFilter(ctx context.Context, cycleState *framework
|
||||
|
||||
s := &preFilterState{}
|
||||
|
||||
s.podInfo = framework.NewPodInfo(pod)
|
||||
if s.podInfo.ParseError != nil {
|
||||
return nil, framework.NewStatus(framework.UnschedulableAndUnresolvable, fmt.Sprintf("parsing pod: %+v", s.podInfo.ParseError))
|
||||
if s.podInfo, err = framework.NewPodInfo(pod); err != nil {
|
||||
return nil, framework.NewStatus(framework.UnschedulableAndUnresolvable, fmt.Sprintf("parsing pod: %+v", err))
|
||||
}
|
||||
|
||||
for i := range s.podInfo.RequiredAffinityTerms {
|
||||
|
@ -162,10 +162,9 @@ func (pl *InterPodAffinity) PreScore(
|
||||
topologyScore: make(map[string]map[string]int64),
|
||||
}
|
||||
|
||||
state.podInfo = framework.NewPodInfo(pod)
|
||||
if state.podInfo.ParseError != nil {
|
||||
if state.podInfo, err = framework.NewPodInfo(pod); err != nil {
|
||||
// Ideally we never reach here, because errors will be caught by PreFilter
|
||||
return framework.AsStatus(fmt.Errorf("failed to parse pod: %w", state.podInfo.ParseError))
|
||||
return framework.AsStatus(fmt.Errorf("failed to parse pod: %w", err))
|
||||
}
|
||||
|
||||
for i := range state.podInfo.PreferredAffinityTerms {
|
||||
|
@ -762,8 +762,11 @@ func (p *PriorityQueue) podsCompareBackoffCompleted(podInfo1, podInfo2 interface
|
||||
// newQueuedPodInfo builds a QueuedPodInfo object.
|
||||
func (p *PriorityQueue) newQueuedPodInfo(pod *v1.Pod, plugins ...string) *framework.QueuedPodInfo {
|
||||
now := p.clock.Now()
|
||||
// ignore this err since apiserver doesn't properly validate affinity terms
|
||||
// and we can't fix the validation for backwards compatibility.
|
||||
podInfo, _ := framework.NewPodInfo(pod)
|
||||
return &framework.QueuedPodInfo{
|
||||
PodInfo: framework.NewPodInfo(pod),
|
||||
PodInfo: podInfo,
|
||||
Timestamp: now,
|
||||
InitialAttemptTimestamp: now,
|
||||
UnschedulablePlugins: sets.NewString(plugins...),
|
||||
|
@ -900,7 +900,9 @@ func (sched *Scheduler) handleSchedulingFailure(ctx context.Context, fwk framewo
|
||||
klog.InfoS("Pod has been assigned to node. Abort adding it back to queue.", "pod", klog.KObj(pod), "node", cachedPod.Spec.NodeName)
|
||||
} else {
|
||||
// As <cachedPod> is from SharedInformer, we need to do a DeepCopy() here.
|
||||
podInfo.PodInfo = framework.NewPodInfo(cachedPod.DeepCopy())
|
||||
// ignore this err since apiserver doesn't properly validate affinity terms
|
||||
// and we can't fix the validation for backwards compatibility.
|
||||
podInfo.PodInfo, _ = framework.NewPodInfo(cachedPod.DeepCopy())
|
||||
if err := sched.SchedulingQueue.AddUnschedulableIfNotPresent(podInfo, sched.SchedulingQueue.SchedulingCycle()); err != nil {
|
||||
klog.ErrorS(err, "Error occurred")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user