Skip to content

Commit

Permalink
Merge pull request karmada-io#3470 from RainbowMango/pr_revert_3283
Browse files Browse the repository at this point in the history
Revert PR3283
  • Loading branch information
karmada-bot authored Apr 26, 2023
2 parents 0f84dd7 + 7f484fd commit b167a4f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
7 changes: 0 additions & 7 deletions pkg/controllers/gracefuleviction/evictiontask.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ func assessEvictionTasks(bindingSpec workv1alpha2.ResourceBindingSpec,
}

func assessSingleTask(task workv1alpha2.GracefulEvictionTask, opt assessmentOption) *workv1alpha2.GracefulEvictionTask {
// avoid the same cluster appearing in both spec.clusters and spec.gracefulEvictionTasks
for _, targetCluster := range opt.scheduleResult {
if task.FromCluster == targetCluster.Name {
return nil
}
}

if task.SuppressDeletion != nil {
if *task.SuppressDeletion {
return &task
Expand Down
19 changes: 0 additions & 19 deletions pkg/controllers/gracefuleviction/evictiontask_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,25 +210,6 @@ func Test_assessSingleTask(t *testing.T) {
},
want: nil,
},
{
name: "cluster appears both in targetClusters and gracefulEvictionTasks",
args: args{
task: workv1alpha2.GracefulEvictionTask{
FromCluster: "member1",
CreationTimestamp: metav1.Time{Time: timeNow.Add(time.Minute * -1)},
},
opt: assessmentOption{
timeout: timeout,
scheduleResult: []workv1alpha2.TargetCluster{
{Name: "member1"},
},
observedStatus: []workv1alpha2.AggregatedStatusItem{
{ClusterName: "member1", Health: workv1alpha2.ResourceHealthy},
},
},
},
want: nil,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit b167a4f

Please sign in to comment.