Skip to content

Commit 852baf8

Browse files
committed
feat: support vlan/bond in v1, vlan in v2 for nocloud
Fixes #9753 Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent dd61ad8 commit 852baf8

13 files changed

Lines changed: 833 additions & 297 deletions

File tree

internal/app/machined/pkg/runtime/v1alpha1/platform/internal/netutils/netutils.go

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ package netutils
77

88
import (
99
"context"
10-
"fmt"
1110
"log"
1211
"time"
1312

14-
"github.com/cenkalti/backoff/v4"
15-
"github.com/cosi-project/runtime/pkg/safe"
1613
"github.com/cosi-project/runtime/pkg/state"
1714
"github.com/siderolabs/go-retry/retry"
1815

@@ -28,44 +25,6 @@ func Wait(ctx context.Context, r state.State) error {
2825
return network.NewReadyCondition(r, network.AddressReady).Wait(ctx)
2926
}
3027

31-
// WaitInterfaces for the interfaces to be up to interact with platform metadata services.
32-
func WaitInterfaces(ctx context.Context, r state.State) error {
33-
backoff := backoff.NewExponentialBackOff()
34-
backoff.MaxInterval = 2 * time.Second
35-
backoff.MaxElapsedTime = 30 * time.Second
36-
37-
for ctx.Err() == nil {
38-
hostInterfaces, err := safe.StateListAll[*network.LinkStatus](ctx, r)
39-
if err != nil {
40-
return fmt.Errorf("error listing host interfaces: %w", err)
41-
}
42-
43-
numPhysical := 0
44-
45-
for iface := range hostInterfaces.All() {
46-
if iface.TypedSpec().Physical() {
47-
numPhysical++
48-
}
49-
}
50-
51-
if numPhysical > 0 {
52-
return nil
53-
}
54-
55-
log.Printf("waiting for physical network interfaces to appear...")
56-
57-
interval := backoff.NextBackOff()
58-
59-
select {
60-
case <-ctx.Done():
61-
return nil
62-
case <-time.After(interval):
63-
}
64-
}
65-
66-
return nil
67-
}
68-
6928
// WaitForDevicesReady waits for devices to be ready.
7029
func WaitForDevicesReady(ctx context.Context, r state.State) error {
7130
log.Printf("waiting for devices to be ready...")

0 commit comments

Comments
 (0)