Skip to content

Commit

Permalink
Merge pull request kubernetes#39718 from foxish/remove-statefulset-sp…
Browse files Browse the repository at this point in the history
…ecial-case

Automatic merge from submit-queue (batch tested with PRs 39230, 39718)

Remove special case for StatefulSets in scheduler

**What this PR does / why we need it**: Removes special case for StatefulSet in scheduler code
/ref: kubernetes#39687

**Special notes for your reviewer**:

**Release note**:

```release-note
Scheduler treats StatefulSet pods as belonging to a single equivalence class.
```
  • Loading branch information
Kubernetes Submit Queue authored Jan 11, 2017
2 parents 3ed7fb6 + dda3b01 commit ba61119
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func GetEquivalencePod(pod *v1.Pod) interface{} {
// to be equivalent
if len(pod.OwnerReferences) != 0 {
for _, ref := range pod.OwnerReferences {
if *ref.Controller && isValidControllerKind(ref.Kind) {
if *ref.Controller {
equivalencePod.ControllerRef = ref
// a pod can only belongs to one controller
break
Expand All @@ -248,17 +248,6 @@ func GetEquivalencePod(pod *v1.Pod) interface{} {
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.
type EquivalencePod struct {
ControllerRef metav1.OwnerReference
Expand Down

0 comments on commit ba61119

Please sign in to comment.