Skip to content

Commit

Permalink
fix: produce stable order of bonds with equinix
Browse files Browse the repository at this point in the history
Fixes the problem when bonds can be listed in random order.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
smira committed May 24, 2024
1 parent 6406193 commit 8a13713
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ import (
"log"
"net/http"
"net/netip"
"slices"
"time"

"github.com/cosi-project/runtime/pkg/safe"
"github.com/cosi-project/runtime/pkg/state"
"github.com/siderolabs/gen/maps"
"github.com/siderolabs/go-procfs/procfs"
"github.com/siderolabs/go-retry/retry"

Expand Down Expand Up @@ -203,7 +205,10 @@ func (p *EquinixMetal) ParseMetadata(ctx context.Context, equinixMetadata *Metad
}
}

for bondName := range bondSlaveIndexes {
bondNames := maps.Keys(bondSlaveIndexes)
slices.Sort(bondNames)

for _, bondName := range bondNames {
bondLink := network.LinkSpecSpec{
ConfigLayer: network.ConfigPlatform,
Name: bondName,
Expand Down

0 comments on commit 8a13713

Please sign in to comment.