Skip to content

Commit 8a13713

Browse files
committed
fix: produce stable order of bonds with equinix
Fixes the problem when bonds can be listed in random order. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent 6406193 commit 8a13713

File tree

1 file changed

+6
-1
lines changed
  • internal/app/machined/pkg/runtime/v1alpha1/platform/equinixmetal

1 file changed

+6
-1
lines changed

internal/app/machined/pkg/runtime/v1alpha1/platform/equinixmetal/equinix.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ import (
1414
"log"
1515
"net/http"
1616
"net/netip"
17+
"slices"
1718
"time"
1819

1920
"github.com/cosi-project/runtime/pkg/safe"
2021
"github.com/cosi-project/runtime/pkg/state"
22+
"github.com/siderolabs/gen/maps"
2123
"github.com/siderolabs/go-procfs/procfs"
2224
"github.com/siderolabs/go-retry/retry"
2325

@@ -203,7 +205,10 @@ func (p *EquinixMetal) ParseMetadata(ctx context.Context, equinixMetadata *Metad
203205
}
204206
}
205207

206-
for bondName := range bondSlaveIndexes {
208+
bondNames := maps.Keys(bondSlaveIndexes)
209+
slices.Sort(bondNames)
210+
211+
for _, bondName := range bondNames {
207212
bondLink := network.LinkSpecSpec{
208213
ConfigLayer: network.ConfigPlatform,
209214
Name: bondName,

0 commit comments

Comments
 (0)