mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Remove special case for StatefulSets in scheduler
This commit is contained in:
parent
3683e0a691
commit
dda3b01d01
@ -238,7 +238,7 @@ func GetEquivalencePod(pod *v1.Pod) interface{} {
|
|||||||
// to be equivalent
|
// to be equivalent
|
||||||
if len(pod.OwnerReferences) != 0 {
|
if len(pod.OwnerReferences) != 0 {
|
||||||
for _, ref := range pod.OwnerReferences {
|
for _, ref := range pod.OwnerReferences {
|
||||||
if *ref.Controller && isValidControllerKind(ref.Kind) {
|
if *ref.Controller {
|
||||||
equivalencePod.ControllerRef = ref
|
equivalencePod.ControllerRef = ref
|
||||||
// a pod can only belongs to one controller
|
// a pod can only belongs to one controller
|
||||||
break
|
break
|
||||||
@ -248,17 +248,6 @@ func GetEquivalencePod(pod *v1.Pod) interface{} {
|
|||||||
return &equivalencePod
|
return &equivalencePod
|
||||||
}
|
}
|
||||||
|
|
||||||
// isValidControllerKind checks if a given controller's kind can be applied to equivalence pod algorithm.
|
|
||||||
func isValidControllerKind(kind string) bool {
|
|
||||||
switch kind {
|
|
||||||
// list of kinds that we cannot handle
|
|
||||||
case StatefulSetKind:
|
|
||||||
return false
|
|
||||||
default:
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// EquivalencePod is a group of pod attributes which can be reused as equivalence to schedule other pods.
|
// EquivalencePod is a group of pod attributes which can be reused as equivalence to schedule other pods.
|
||||||
type EquivalencePod struct {
|
type EquivalencePod struct {
|
||||||
ControllerRef metav1.OwnerReference
|
ControllerRef metav1.OwnerReference
|
||||||
|
Loading…
Reference in New Issue
Block a user