Skip to content

Commit

Permalink
chore: remove dead disruptable code (#1751)
Browse files Browse the repository at this point in the history
  • Loading branch information
rschalo authored Oct 14, 2024
1 parent 313de6d commit a652a4a
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions pkg/controllers/state/statenode.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/utils/clock"
"sigs.k8s.io/controller-runtime/pkg/client"

v1 "sigs.k8s.io/karpenter/pkg/apis/v1"
Expand Down Expand Up @@ -89,20 +88,6 @@ func (n StateNodes) Pods(ctx context.Context, kubeClient client.Client) ([]*core
return pods, nil
}

// Disruptable filters StateNodes that are meet the IsDisruptable condition
func (n StateNodes) Disruptable(ctx context.Context, clk clock.Clock, kubeClient client.Client) (StateNodes, error) {
pdbs, err := pdb.NewLimits(ctx, clk, kubeClient)
if err != nil {
return StateNodes{}, fmt.Errorf("constructing pdbs, %w", err)
}
n = lo.Filter(n, func(node *StateNode, _ int) bool {
nodeDisruptibleErr := node.ValidateNodeDisruptable(ctx, kubeClient)
_, podDisruptibleErr := node.ValidatePodsDisruptable(ctx, kubeClient, pdbs)
return nodeDisruptibleErr == nil && podDisruptibleErr == nil
})
return n, nil
}

func (n StateNodes) ReschedulablePods(ctx context.Context, kubeClient client.Client) ([]*corev1.Pod, error) {
var pods []*corev1.Pod
for _, node := range n {
Expand Down

0 comments on commit a652a4a

Please sign in to comment.