Skip to content

Commit d45474f

Browse files
committed
fix data action test
1 parent e231e56 commit d45474f

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

controllers/apps/component/component_controller_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package component
2121

2222
import (
2323
"fmt"
24+
"slices"
2425
"strconv"
2526
"time"
2627

@@ -347,6 +348,7 @@ var _ = Describe("Component Controller", func() {
347348
for i := initReplicas; i < targetReplicas; i++ {
348349
replicas = append(replicas, fmt.Sprintf("%s-%d", compKey.Name, i))
349350
}
351+
slices.Sort(replicas)
350352
parameters, err := component.NewReplicaTask(compKey.Name, uid, source, replicas)
351353
Expect(err).NotTo(HaveOccurred())
352354

controllers/apps/component/transformer_component_workload_ops.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ func (r *componentWorkloadOps) dataReplicationTask() error {
149149
replicas := slices.Clone(newReplicas)
150150
replicas = append(replicas, unprovisionedReplicas.UnsortedList()...)
151151
replicas = append(replicas, provisioningReplicas...)
152+
slices.Sort(replicas)
152153
parameters, err := component.NewReplicaTask(r.synthesizeComp.FullCompName, r.synthesizeComp.Generation, source, replicas)
153154
if err != nil {
154155
return err

0 commit comments

Comments
 (0)