Skip to content

Commit 8f578ea

Browse files
author
Ryan Zhang
committed
refactor the scheduler
Signed-off-by: Ryan Zhang <[email protected]>
1 parent d83c930 commit 8f578ea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/scheduler/framework/frameworkutils.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,11 @@ func crossReferenceValidTargetsWithBindings(
765765
for _, binding := range obsolete {
766766
if _, ok := validTargetMap[binding.GetBindingSpec().TargetCluster]; !ok {
767767
// The cluster is no longer a valid target; mark the binding as unscheduled.
768-
toDelete = append(toDelete, binding)
768+
if crb, ok := binding.(*placementv1beta1.ClusterResourceBinding); ok {
769+
toDelete = append(toDelete, crb)
770+
} else {
771+
return nil, nil, nil, controller.NewUnexpectedBehaviorError(fmt.Errorf("unexpected binding type: %T", binding))
772+
}
769773
}
770774
}
771775

0 commit comments

Comments
 (0)