m/n/c/network: make bringup order deterministic
This will ensure that given the same static network config the bringup
sequence is the same. In turn this will make the MAC address of bonds
static as well as generally providing more consistent behavior.
Change-Id: If3e381e685195be2fa473f1610cc0418b25f85a6
Reviewed-on: https://review.monogon.dev/c/monogon/+/3138
Tested-by: Jenkins CI
Reviewed-by: Serge Bazanski <serge@monogon.tech>
diff --git a/metropolis/node/core/network/static.go b/metropolis/node/core/network/static.go
index b1b15eb..0bbbab6 100644
--- a/metropolis/node/core/network/static.go
+++ b/metropolis/node/core/network/static.go
@@ -242,7 +242,7 @@
}
return nil, errors.New(strings.Join(errMsgs, "; "))
}
- interfaceOrder, err := depGraph.TopologicalOrder()
+ interfaceOrder, err := depGraph.DetTopologicalOrder(strings.Compare)
if err != nil {
return nil, fmt.Errorf("unable to calculate interface setup order: %w", err)
}