Skip to content

Commit

Permalink
Merge pull request #302 from karelyatin/OSPRH-7480
Browse files Browse the repository at this point in the history
Sort nicMappings to have consistent data for ObjectHash
  • Loading branch information
openshift-merge-bot[bot] authored Jun 10, 2024
2 parents 2847b4c + 749bc3b commit 22bca1c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/ovncontroller/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package ovncontroller
import (
"context"
"fmt"
"sort"
"strings"

"github.com/openstack-k8s-operators/lib-common/modules/common/env"
Expand All @@ -31,9 +32,10 @@ func getPhysicalNetworks(
// the same name as "br-<physical network>"
// NOTE(slaweq): interface names aren't important as inside Pod they will be
// named based on the NicMappings keys
return strings.Join(
maps.Keys(instance.Spec.NicMappings), " ",
)
// Need to pass sorted data as Map is unordered
nicMappings := maps.Keys(instance.Spec.NicMappings)
sort.Strings(nicMappings)
return strings.Join(nicMappings, " ")
}

func getOVNControllerPods(
Expand Down

0 comments on commit 22bca1c

Please sign in to comment.