enqueueAffectedBindings and enqueueAffectedCRBs add schedulerNameFilter
Signed-off-by: huangyanfeng <huangyanfeng1992@gmail.com>
This commit is contained in:
parent
3eba2a950f
commit
27971f4cd4
|
@ -258,7 +258,9 @@ func (s *Scheduler) enqueueAffectedBindings(cluster *clusterv1alpha1.Cluster) er
|
||||||
// for scheduling or its status has not been synced to the
|
// for scheduling or its status has not been synced to the
|
||||||
// cache. Just enqueue the binding to avoid missing the cluster
|
// cache. Just enqueue the binding to avoid missing the cluster
|
||||||
// update event.
|
// update event.
|
||||||
|
if schedulerNameFilter(s.schedulerName, binding.Spec.SchedulerName) {
|
||||||
s.onResourceBindingRequeue(binding, metrics.ClusterChanged)
|
s.onResourceBindingRequeue(binding, metrics.ClusterChanged)
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
affinityIndex := getAffinityIndex(placementPtr.ClusterAffinities, binding.Status.SchedulerObservedAffinityName)
|
affinityIndex := getAffinityIndex(placementPtr.ClusterAffinities, binding.Status.SchedulerObservedAffinityName)
|
||||||
|
@ -273,9 +275,11 @@ func (s *Scheduler) enqueueAffectedBindings(cluster *clusterv1alpha1.Cluster) er
|
||||||
fallthrough
|
fallthrough
|
||||||
case util.ClusterMatches(cluster, *affinity):
|
case util.ClusterMatches(cluster, *affinity):
|
||||||
// If the cluster manifest match the affinity, add it to the queue, trigger rescheduling
|
// If the cluster manifest match the affinity, add it to the queue, trigger rescheduling
|
||||||
|
if schedulerNameFilter(s.schedulerName, binding.Spec.SchedulerName) {
|
||||||
s.onResourceBindingRequeue(binding, metrics.ClusterChanged)
|
s.onResourceBindingRequeue(binding, metrics.ClusterChanged)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -299,7 +303,9 @@ func (s *Scheduler) enqueueAffectedCRBs(cluster *clusterv1alpha1.Cluster) error
|
||||||
// for scheduling or its status has not been synced to the
|
// for scheduling or its status has not been synced to the
|
||||||
// cache. Just enqueue the binding to avoid missing the cluster
|
// cache. Just enqueue the binding to avoid missing the cluster
|
||||||
// update event.
|
// update event.
|
||||||
|
if schedulerNameFilter(s.schedulerName, binding.Spec.SchedulerName) {
|
||||||
s.onClusterResourceBindingRequeue(binding, metrics.ClusterChanged)
|
s.onClusterResourceBindingRequeue(binding, metrics.ClusterChanged)
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
affinityIndex := getAffinityIndex(placementPtr.ClusterAffinities, binding.Status.SchedulerObservedAffinityName)
|
affinityIndex := getAffinityIndex(placementPtr.ClusterAffinities, binding.Status.SchedulerObservedAffinityName)
|
||||||
|
@ -314,9 +320,11 @@ func (s *Scheduler) enqueueAffectedCRBs(cluster *clusterv1alpha1.Cluster) error
|
||||||
fallthrough
|
fallthrough
|
||||||
case util.ClusterMatches(cluster, *affinity):
|
case util.ClusterMatches(cluster, *affinity):
|
||||||
// If the cluster manifest match the affinity, add it to the queue, trigger rescheduling
|
// If the cluster manifest match the affinity, add it to the queue, trigger rescheduling
|
||||||
|
if schedulerNameFilter(s.schedulerName, binding.Spec.SchedulerName) {
|
||||||
s.onClusterResourceBindingRequeue(binding, metrics.ClusterChanged)
|
s.onClusterResourceBindingRequeue(binding, metrics.ClusterChanged)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue