Skip to content

Commit

Permalink
和descheduler 联动进行安全重调取
Browse files Browse the repository at this point in the history
Signed-off-by: gj199575 <409237405@qq.com>
  • Loading branch information
gj409237405 committed Jul 14, 2023
1 parent 5302995 commit 33360c5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/scheduler/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,12 @@ func (db *DefaultBinder) Bind(kubeClient kubernetes.Interface, tasks []*scheduli
var errTasks []*schedulingapi.TaskInfo
for _, task := range tasks {
p := task.Pod
if err := kubeClient.CoreV1().Pods(p.Namespace).Bind(context.TODO(),
if p.Annotations["is-fake"] == "true" {
p.Annotations["fake-pod"] = task.NodeName
p.Spec.NodeName = ""
update, err := kubeClient.CoreV1().Pods(p.Namespace).Update(context.TODO(), p, metav1.UpdateOptions{})
klog.Info(update, err)
} else if err := kubeClient.CoreV1().Pods(p.Namespace).Bind(context.TODO(),
&v1.Binding{
ObjectMeta: metav1.ObjectMeta{Namespace: p.Namespace, Name: p.Name, UID: p.UID, Annotations: p.Annotations},
Target: v1.ObjectReference{
Expand Down

0 comments on commit 33360c5

Please sign in to comment.