Scramble object order
@@ -3,6 +3,7 @@ package controllers
import (
"context"
"fmt"
+ "math/rand"
"reflect"
"strconv"
"strings"
@@ -1812,6 +1813,10 @@ func (m *MigrationController) applyResources(
objectChan := make(chan runtime.Unstructured, 100)
errorChan := make(chan error, 100)
+ // Shuffle Object order before applying so we can get parallelism between resource types
+ rand.Seed(time.Now().UnixNano())
+ rand.Shuffle(len(updatedObjects), func(i, j int) { updatedObjects[i], updatedObjects[j] = updatedObjects[j], updatedObjects[i] })
+
logrus.Infof("Updating %v objects with %v workers", numObjects, m.migrationMaxThreads)
for w := 0; w < m.migrationMaxThreads; w++ {
go worker(objectChan, errorChan)
