Skip to content

Commit

Permalink
Merge pull request #11002 from k8s-infra-cherrypick-robot/cherry-pick…
Browse files Browse the repository at this point in the history
…-10998-to-release-1.7

[release-1.7] 🐛 Ensure DockerMachinePool providerIDList is deterministic
  • Loading branch information
k8s-ci-robot authored Aug 2, 2024
2 parents 16fa6e3 + ddd1f4a commit 29f537d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/framework/resourceversion_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func ValidateResourceVersionStable(ctx context.Context, proxy ClusterProxy, name
}, 1*time.Minute, 15*time.Second).Should(Succeed(), "Resource versions never became stable")

// Verify resource versions are stable for a while.
byf("Check Resource versions remains stable")
byf("Check Resource versions remain stable")
Consistently(func(g Gomega) {
objectsWithResourceVersion, err := getObjectsWithResourceVersion(ctx, proxy, namespace, ownerGraphFilterFunction)
g.Expect(err).ToNot(HaveOccurred())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package controllers
import (
"context"
"fmt"
"sort"
"time"

"github.com/pkg/errors"
Expand Down Expand Up @@ -302,6 +303,8 @@ func (r *DockerMachinePoolReconciler) reconcileNormal(ctx context.Context, clust
dockerMachinePool.Spec.ProviderIDList = append(dockerMachinePool.Spec.ProviderIDList, *dockerMachine.Spec.ProviderID)
}
}
// Ensure the providerIDList is deterministic (getDockerMachines doesn't guarantee a specific order)
sort.Strings(dockerMachinePool.Spec.ProviderIDList)

dockerMachinePool.Status.Replicas = int32(len(dockerMachineList.Items))

Expand Down

0 comments on commit 29f537d

Please sign in to comment.