Skip to content

Commit 292bf72

Browse files
jinglinliangk8s-infra-cherrypick-robot
authored andcommitted
Allow draining when StatefulSet kind has custom API Group
1 parent 0cf66de commit 292bf72

File tree

1 file changed

+5
-0
lines changed
  • cluster-autoscaler/simulator/drainability/rules/replicacount

1 file changed

+5
-0
lines changed

cluster-autoscaler/simulator/drainability/rules/replicacount/rule.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ func (r *Rule) Drainable(drainCtx *drainability.DrainContext, pod *apiv1.Pod, _
111111
return drainability.NewBlockedStatus(drain.ControllerNotFound, fmt.Errorf("replication controller for %s/%s is not available, err: %v", pod.Namespace, pod.Name, err))
112112
}
113113
} else if refKind == "StatefulSet" {
114+
if refGroup.Group != "apps" {
115+
// We don't have a listener for the other StatefulSet group.
116+
return drainability.NewUndefinedStatus()
117+
}
118+
114119
ss, err := drainCtx.Listers.StatefulSetLister().StatefulSets(controllerNamespace).Get(controllerRef.Name)
115120

116121
if err != nil && ss == nil {

0 commit comments

Comments
 (0)